{"id":2207,"date":"2022-02-26T13:18:30","date_gmt":"2022-02-26T19:18:30","guid":{"rendered":"https:\/\/www.uv.mx\/personal\/gvera\/?p=2207"},"modified":"2022-02-27T10:09:17","modified_gmt":"2022-02-27T16:09:17","slug":"como-instalar-php-sobre-iis-10-en-windows-server-2019-datacenter","status":"publish","type":"post","link":"https:\/\/www.uv.mx\/personal\/gvera\/2022\/02\/26\/como-instalar-php-sobre-iis-10-en-windows-server-2019-datacenter\/","title":{"rendered":"Como instalar PHP sobre IIS 10 en Windows Server 2019 Datacenter"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p>Vamos a aprender a instalar PHP sobre IIS en Windows 2019 Server de manera manual. Claro que hay otras formas de hacerlo, como mediante <a rel=\"noreferrer noopener\" href=\"https:\/\/www.iis.net\/downloads\/microsoft\/web-platform-installer\" target=\"_blank\">Web Platform Installer<\/a> (Web PI)&nbsp;. Pero yo considero que manualmente es la mejor forma de hacerlo si eres desarollador; pues as\u00ed sabr\u00e1s exactamente donde est\u00e1n tus archivos de configuraci\u00f3n e instalaci\u00f3n.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Paso 1: Instalar IIS Express 10<\/h2>\n\n\n\n<p>Desde el Server Manager, seleccionamos <strong>Manage <\/strong>y luego <strong>Add Roles and Features<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"393\" src=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-1-500x393.png\" alt=\"\" class=\"wp-image-2209\" srcset=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-1-500x393.png 500w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-1-300x236.png 300w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-1-768x603.png 768w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-1-96x75.png 96w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-1.png 1026w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/figure><\/div>\n\n\n\n<p>En el siguiente cuadro de dialogo, seleccionamos <strong>Role-based or feature based installation<\/strong>. En la siguiente ventana seleccionamos <strong>Select a server from the server pool<\/strong> asegurandonos que este seleccionado el servidor local.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"393\" src=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-2-500x393.png\" alt=\"\" class=\"wp-image-2210\" srcset=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-2-500x393.png 500w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-2-300x236.png 300w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-2-768x603.png 768w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-2-96x75.png 96w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-2.png 1026w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/figure><\/div>\n\n\n\n<p>En la siguiente ventana, seleccionamos la opci\u00f3n <strong>Web Server (IIS)<\/strong> y la casilla <strong>CGI<\/strong>. Esto es importante porque PHP se ejecuta sobre <strong>FastCGI<\/strong> del IIS.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"393\" src=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-3-500x393.png\" alt=\"\" class=\"wp-image-2211\" srcset=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-3-500x393.png 500w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-3-300x236.png 300w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-3-768x603.png 768w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-3-96x75.png 96w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-3.png 1026w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/figure><\/div>\n\n\n\n<p>Una vez terminada la instalaci\u00f3n, podemoa abrir el navegador web local y dirigirnos a la direcci\u00f3n URL <strong>http:\/\/localhost<\/strong> y se deber\u00e1 ver la p\u00e1gina incial del IIS.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"393\" src=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-4-500x393.png\" alt=\"\" class=\"wp-image-2212\" srcset=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-4-500x393.png 500w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-4-300x236.png 300w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-4-768x603.png 768w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-4-96x75.png 96w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-4.png 1026w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Paso 2: Descargar PHP<\/h2>\n\n\n\n<p>PHP se encuentra disponible para descargar gratuitamente desde su <a href=\"https:\/\/windows.php.net\/download\/\" data-type=\"URL\" data-id=\"https:\/\/windows.php.net\/download\/\" target=\"_blank\" rel=\"noreferrer noopener\">sitio oficial para Windows<\/a>. Asegur\u00e1te de descargar la versi\u00f3n deseada. En este caso ser\u00e1 la versi\u00f3n <strong>PHP 7.4 (7.4.25)<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"356\" src=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/Descarga-de-PHP-500x356.jpg\" alt=\"\" class=\"wp-image-2155\" srcset=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/Descarga-de-PHP-500x356.jpg 500w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/Descarga-de-PHP-300x214.jpg 300w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/Descarga-de-PHP-96x68.jpg 96w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/Descarga-de-PHP.jpg 606w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/figure><\/div>\n\n\n\n<p>Es importante que eligas la versi\u00f3n <strong>VC15 x64 Non Thread Safe<\/strong> que es la que funciona con <strong>FastCGI<\/strong> de <strong>IIS Express<\/strong>. Finalmente elegimos el archivo <strong>Zip <\/strong>y lo descargamos en nuestro equipo.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Descargar Visual C++ Redistributable<\/h3>\n\n\n\n<p>La versi\u00f3n <strong>VC15 de PHP<\/strong> requiere tener instalado el <strong>Visual C++ Redistributable for Visual Studio 2015-2019 x64<\/strong>. Si no lo tienes ya instalado en tu equipo, desc\u00e1rgalo desde la misma <a href=\"https:\/\/windows.php.net\/download\/\" data-type=\"URL\" data-id=\"https:\/\/windows.php.net\/download\/\" target=\"_blank\" rel=\"noreferrer noopener\">p\u00e1gina de descargas de PHP para Windows<\/a>. <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"359\" height=\"472\" src=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/Descarga-de-Visual-C.jpg\" alt=\"\" class=\"wp-image-2158\" srcset=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/Descarga-de-Visual-C.jpg 359w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/Descarga-de-Visual-C-228x300.jpg 228w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/Descarga-de-Visual-C-81x107.jpg 81w\" sizes=\"auto, (max-width: 359px) 100vw, 359px\" \/><\/figure><\/div>\n\n\n\n<p>Inst\u00e1lalo y si lo solicita, reinicia tu equipo antes de seguir con el siguiente paso.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Paso 4: Configurar PHP en Windows<\/h2>\n\n\n\n<p>Extrae el archivo <strong>Zip<\/strong> descargado en el paso anterior y renombra la carpeta a <strong>v7.4<\/strong> (por la versi\u00f3n descargada de PHP).<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"245\" height=\"128\" src=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/Carpeta-v7.4.jpg\" alt=\"\" class=\"wp-image-2160\" srcset=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/Carpeta-v7.4.jpg 245w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/Carpeta-v7.4-96x50.jpg 96w\" sizes=\"auto, (max-width: 245px) 100vw, 245px\" \/><\/figure><\/div>\n\n\n\n<p>Col\u00f3cate en la carpeta archivos de programa en la ruta <strong>C:\\Program Files\\<\/strong> y crea la <strong>carpeta PHP<\/strong>. <em>Nota: A IIS le gusta colocar a PHP dentro de esta ruta, pero puedes colocarlo en cualquier otra parte.<\/em><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"388\" height=\"212\" src=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-5.png\" alt=\"\" class=\"wp-image-2213\" srcset=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-5.png 388w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-5-300x164.png 300w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-5-96x52.png 96w\" sizes=\"auto, (max-width: 388px) 100vw, 388px\" \/><\/figure><\/div>\n\n\n\n<p>Finalmente copia la carpeta <strong>v7.4<\/strong> dentro de la <strong>carpeta PHP<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"302\" height=\"130\" src=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-6.png\" alt=\"\" class=\"wp-image-2214\" srcset=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-6.png 302w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-6-300x129.png 300w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-6-96x41.png 96w\" sizes=\"auto, (max-width: 302px) 100vw, 302px\" \/><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Archivo de configuraci\u00f3n de PHP<\/h3>\n\n\n\n<p>Dentro de la carpeta de configuraci\u00f3n de PHP <strong>C:\\Program Files\\IIS Express\\PHP\\v7.4<\/strong>., copia y pega el archivo <strong>php.ini-production<\/strong>. <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"203\" height=\"72\" src=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-7.png\" alt=\"\" class=\"wp-image-2216\" srcset=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-7.png 203w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-7-96x34.png 96w\" sizes=\"auto, (max-width: 203px) 100vw, 203px\" \/><\/figure><\/div>\n\n\n\n<p>Ren\u00f3mbralo como <strong>php.ini<\/strong>. Este es el nombre que a PHP le gusta para su archivo de configuraci\u00f3n.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"347\" height=\"151\" src=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-8.png\" alt=\"\" class=\"wp-image-2218\" srcset=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-8.png 347w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-8-300x131.png 300w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-8-96x42.png 96w\" sizes=\"auto, (max-width: 347px) 100vw, 347px\" \/><\/figure><\/div>\n\n\n\n<p>Abre el archivo <strong>php.ini<\/strong> en el <strong>bloc de notas<\/strong> o <strong>Visual Studio Code<\/strong>. Al final del archivo, agrega la ruta de la carpeta de extensiones. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>; Esto le dice a PHP donde estan las extensiones\nextension_dir = \"ext\"<\/code><\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"58\" src=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/image-500x58.png\" alt=\"\" class=\"wp-image-2166\" srcset=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/image-500x58.png 500w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/image-300x35.png 300w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/image-96x11.png 96w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/image.png 691w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/figure><\/div>\n\n\n\n<p>En caso de necesitar alguna extensi\u00f3n, se puede agregar debajo de esta l\u00ednea.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"495\" src=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/Extensiones-de-php-500x495.jpg\" alt=\"\" class=\"wp-image-2165\" srcset=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/Extensiones-de-php-500x495.jpg 500w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/Extensiones-de-php-300x297.jpg 300w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/Extensiones-de-php-150x150.jpg 150w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/Extensiones-de-php-96x95.jpg 96w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/Extensiones-de-php.jpg 505w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Agregar PHP al PATH de Windows<\/h3>\n\n\n\n<p>Bot\u00f3n derecho en el <strong>men\u00fa inicio de Windows<\/strong>, luego hacer clic en <strong>System<\/strong> y debajo de <strong>Related Settings<\/strong> hacer clic en <strong>System info<\/strong>. Dentro del Panel de Control, clic en el men\u00fa de la derecha en <strong>Advanced system settings<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"407\" height=\"471\" src=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-9.png\" alt=\"\" class=\"wp-image-2219\" srcset=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-9.png 407w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-9-259x300.png 259w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-9-92x107.png 92w\" sizes=\"auto, (max-width: 407px) 100vw, 407px\" \/><\/figure><\/div>\n\n\n\n<p>En la ventana <strong>System Properties<\/strong>, selecciona la pesta\u00f1a <strong>Advanced<\/strong> y luego clic en <strong>Environment Variables.<\/strong><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"479\" src=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-10-500x479.png\" alt=\"\" class=\"wp-image-2220\" srcset=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-10-500x479.png 500w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-10-300x288.png 300w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-10-96x92.png 96w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-10.png 607w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/figure><\/div>\n\n\n\n<p>En <strong> <strong>Environment Variables<\/strong><\/strong>, selecciona <strong>Path<\/strong> y luego haga clic en <strong>Editar<\/strong>. Clic en <strong>New <\/strong>y agrega la ruta a la carpeta de instalaci\u00f3n de PHP <strong>C:\\Program Files\\PHP\\v7.4<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"477\" src=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-11-500x477.png\" alt=\"\" class=\"wp-image-2221\" srcset=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-11-500x477.png 500w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-11-300x286.png 300w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-11-96x92.png 96w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-11.png 522w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/figure><\/div>\n\n\n\n<p>Clic en <strong>OK<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Paso 5: Configurar PHP en IIS Express<\/h2>\n\n\n\n<p>Para que IIS reconozca los scripts de PHP, debemos agregar un manejador para extensiones *.php con el m\u00f3dulo <strong>FastCgi<\/strong> de IIS.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/image-5.png\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"143\" src=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/image-5-500x143.png\" alt=\"\" class=\"wp-image-2171\" srcset=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/image-5-500x143.png 500w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/image-5-300x86.png 300w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/image-5-768x220.png 768w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/image-5-96x27.png 96w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/image-5.png 866w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><\/figure><\/div>\n\n\n\n<p>Esto se hace editando el archivo de configuraci\u00f3n de IIS Express en la ruta: <strong>C:\\Windows\\System32\\inetsrv\\Config<\/strong>. <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/image-6.png\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"30\" src=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/image-6-500x30.png\" alt=\"\" class=\"wp-image-2172\" srcset=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/image-6-500x30.png 500w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/image-6-300x18.png 300w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/image-6-768x46.png 768w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/image-6-96x6.png 96w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/image-6.png 1133w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><\/figure><\/div>\n\n\n\n<p>Preferentemente este archivo no se edita manualmente. IIS proporciona una herramienta de l\u00ednea de comandos: <strong>C:\\Windows\\System32\\inetsrv\\appcm.exe<\/strong>.<\/p>\n\n\n\n<p>Abre una ventana de comandos y ejecuta el archivo <strong>instala-php.bat<\/strong> que se proporciona a continuaci\u00f3n:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"271\" src=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-16-500x271.png\" alt=\"\" class=\"wp-image-2226\" srcset=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-16-500x271.png 500w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-16-300x162.png 300w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-16-768x416.png 768w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-16-96x52.png 96w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-16.png 1473w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/figure><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>@echo off\r\n\r\nREM Configuraci\u00f3n de PHP en IIS\r\n\r\nREM Descargar la compilaci\u00f3n de PHP desde Web Platform Installer o el archivo zip desde http:\/\/windows.php.net\/downloads\/\r\n\r\nREM Ruta SIN COMILLAS al directorio donde se ha descomprimido o instalado la carpeta de PHP\r\nset phppath=C:\\Program Files\\PHP\\v7.4\r\n\r\nREM Ruta CON COMILLAS de PHP para concatenar variables string\r\nset phppath2=\"%phppath%\"\r\n\r\nREM Limpiar los manejadores actuales de PHP\r\n\"C:\\Windows\\System32\\inetsrv\\appcmd\" clear config \/section:system.webServer\/fastCGI\r\nREM El siguiente comando generar\u00e1 un mensaje de error si PHP no est\u00e1 instalado. Esto puede ser ignorado.\r\n\"C:\\Windows\\System32\\inetsrv\\appcmd\" set config \/section:system.webServer\/handlers \/-&#091;name='PHP_via_FastCGI']\r\n\r\nREM Instalar el manejador de PHP\r\n\"C:\\Windows\\System32\\inetsrv\\appcmd\" set config \/section:system.webServer\/fastCGI \/+&#091;fullPath='%phppath2%\\php-cgi.exe']\r\n\"C:\\Windows\\System32\\inetsrv\\appcmd\" set config \/section:system.webServer\/handlers \/+&#091;name='PHP_via_FastCGI',path='*.php',verb='*',modules='FastCgiModule',scriptProcessor='%phppath2%\\php-cgi.exe',resourceType='Unspecified']\r\n\"C:\\Windows\\System32\\inetsrv\\appcmd\" set config \/section:system.webServer\/handlers \/accessPolicy:Read,Script\r\n\r\nREM Configurar las variables de FastCGI\r\n\"C:\\Windows\\System32\\inetsrv\\appcmd\" set config -section:system.webServer\/fastCgi \/&#091;fullPath='%phppath2%\\php-cgi.exe'].monitorChangesTo:php.ini\r\n\"C:\\Windows\\System32\\inetsrv\\appcmd\" set config -section:system.webServer\/fastCgi \/&#091;fullPath='%phppath2%\\php-cgi.exe'].activityTimeout:600\r\n\"C:\\Windows\\System32\\inetsrv\\appcmd\" set config -section:system.webServer\/fastCgi \/&#091;fullPath='%phppath2%\\php-cgi.exe'].requestTimeout:600\r\n\"C:\\Windows\\System32\\inetsrv\\appcmd\" set config -section:system.webServer\/fastCgi \/&#091;fullPath='%phppath2%\\php-cgi.exe'].instanceMaxRequests:10000\r\n\"C:\\Windows\\System32\\inetsrv\\appcmd\".exe set config -section:system.webServer\/fastCgi \/+\"&#091;fullPath='%phppath%\\php-cgi.exe'].environmentVariables.&#091;name='PHP_FCGI_MAX_REQUESTS',value='10000']\"\r\n\"C:\\Windows\\System32\\inetsrv\\appcmd\".exe set config -section:system.webServer\/fastCgi \/+\"&#091;fullPath='%phppath%\\php-cgi.exe'].environmentVariables.&#091;name='PHPRC',value='%phppath%\\php.ini']\"\r\n\r\nREM Agrega index.php como documento default\r\n\"C:\\Windows\\System32\\inetsrv\\appcmd\" set config \/section:defaultDocument \/-files.&#091;value='index.php']\r\n\"C:\\Windows\\System32\\inetsrv\\appcmd\" set config \/section:defaultDocument \/+files.&#091;value='index.php']<\/code><\/pre>\n\n\n\n<p>Aseg\u00farate de que la primer variable que apunte a tu instalaci\u00f3n de PHP:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"35\" src=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-14-500x35.png\" alt=\"\" class=\"wp-image-2224\" srcset=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-14-500x35.png 500w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-14-300x21.png 300w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-14-768x53.png 768w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-14-96x7.png 96w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-14.png 892w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>REM Ruta SIN COMILLAS al directorio donde se ha descomprimido o instalado la carpeta de PHP\nset phppath=C:\\Program Files\\PHP\\v7.4\n<\/code><\/pre>\n\n\n\n<p>Si no se ha instalado PHP previamente, la primera l\u00ednea va a mandar un error de elemento no encontrado. Este error es esperado y normal.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"279\" src=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-15-500x279.png\" alt=\"\" class=\"wp-image-2225\" srcset=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-15-500x279.png 500w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-15-300x167.png 300w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-15-768x429.png 768w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-15-96x54.png 96w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-15.png 971w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Paso 6: Prueba tu instalaci\u00f3n de PHP<\/h2>\n\n\n\n<p>Colocate en la ruta <strong>C:\\inetpub\\wwwroot<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"417\" height=\"142\" src=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-17.png\" alt=\"\" class=\"wp-image-2227\" srcset=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-17.png 417w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-17-300x102.png 300w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-17-96x33.png 96w\" sizes=\"auto, (max-width: 417px) 100vw, 417px\" \/><\/figure><\/div>\n\n\n\n<p>Y luego, <strong>sin seleccionar arcchivos<\/strong>, clic derecho en algun espacio en blanco en <strong>Abrir con Visual Code<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"391\" src=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-18-500x391.png\" alt=\"\" class=\"wp-image-2228\" srcset=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-18-500x391.png 500w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-18-300x235.png 300w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-18-96x75.png 96w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-18.png 524w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/figure><\/div>\n\n\n\n<p>Escribe el nombre del archivo <strong>phpinfo.php<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"235\" height=\"155\" src=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-19.png\" alt=\"\" class=\"wp-image-2229\" srcset=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-19.png 235w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-19-96x63.png 96w\" sizes=\"auto, (max-width: 235px) 100vw, 235px\" \/><\/figure><\/div>\n\n\n\n<p>Abre el archivo en el bloc de notas y escribe el c\u00f3digo para mostrar informaci\u00f3n de PHP dentro de <strong>index.php<\/strong>:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"40\" src=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/image-13-500x40.png\" alt=\"\" class=\"wp-image-2182\" srcset=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/image-13-500x40.png 500w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/image-13-300x24.png 300w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/image-13-96x8.png 96w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2021\/10\/image-13.png 646w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/figure><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php phpinfo(); ?&gt;\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Inicia el sitio Web<\/h3>\n\n\n\n<p>Ya tenemos todo listo. Abre tu navegador web local y dirigete a la direcci\u00f3n URL <strong>http:\/\/localhost\/phpinfo.php<\/strong><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"366\" src=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-20-500x366.png\" alt=\"\" class=\"wp-image-2230\" srcset=\"https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-20-500x366.png 500w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-20-300x219.png 300w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-20-768x562.png 768w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-20-96x70.png 96w, https:\/\/www.uv.mx\/personal\/gvera\/files\/2022\/02\/image-20.png 960w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/figure><\/div>\n\n\n\n<p>Eso es todo! Ya podemos comenzar a publicar nuestros sitios web con PHP sobre IIS. M\u00e1s adelante podr\u00edamos agregar la funcionalidad certificado SSL, pero eso lo veremos en otra entrada m\u00e1s adelante.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Vamos a aprender a instalar PHP sobre IIS en Windows 2019 Server de manera manual. Claro que hay otras formas de hacerlo, como mediante Web Platform Installer (Web PI)&nbsp;. Pero yo considero que manualmente es la mejor forma de hacerlo si eres desarollador; pues as\u00ed sabr\u00e1s exactamente donde est\u00e1n tus archivos de configuraci\u00f3n e instalaci\u00f3n&#8230;.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-2207","post","type-post","status-publish","format-standard","hentry","category-blog"],"_links":{"self":[{"href":"https:\/\/www.uv.mx\/personal\/gvera\/wp-json\/wp\/v2\/posts\/2207","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.uv.mx\/personal\/gvera\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.uv.mx\/personal\/gvera\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.uv.mx\/personal\/gvera\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.uv.mx\/personal\/gvera\/wp-json\/wp\/v2\/comments?post=2207"}],"version-history":[{"count":2,"href":"https:\/\/www.uv.mx\/personal\/gvera\/wp-json\/wp\/v2\/posts\/2207\/revisions"}],"predecessor-version":[{"id":2231,"href":"https:\/\/www.uv.mx\/personal\/gvera\/wp-json\/wp\/v2\/posts\/2207\/revisions\/2231"}],"wp:attachment":[{"href":"https:\/\/www.uv.mx\/personal\/gvera\/wp-json\/wp\/v2\/media?parent=2207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.uv.mx\/personal\/gvera\/wp-json\/wp\/v2\/categories?post=2207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.uv.mx\/personal\/gvera\/wp-json\/wp\/v2\/tags?post=2207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}