{"id":605,"date":"2022-10-17T21:10:21","date_gmt":"2022-10-18T04:10:21","guid":{"rendered":"https:\/\/blog.iabsolute.com\/?p=605"},"modified":"2022-10-17T21:10:21","modified_gmt":"2022-10-18T04:10:21","slug":"installing-php-on-windows-10-and-iis","status":"publish","type":"post","link":"https:\/\/blog.iabsolute.com\/?p=605","title":{"rendered":"Installing PHP on Windows 10 and\u00a0IIS"},"content":{"rendered":"\n<p><strong>1. Configure IIS<\/strong><\/p>\n\n\n\n<p>Control Panel | Programs | Turn Windows features on or off<\/p>\n\n\n\n<p>Check Internet Information Services<br>Check IIS | World Wide Web Services | Application Development Features | CGI<br>OK<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/jamesmccaffrey.wordpress.com\/2017\/01\/23\/installing-php-on-windows-10-and-iis\/01_configureiis\/\"><img decoding=\"async\" src=\"https:\/\/jamesmccaffrey.files.wordpress.com\/2017\/01\/01_configureiis.jpg?w=195&amp;h=300\" alt=\"01_configureiis\" class=\"wp-image-5133\"\/><\/a><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>2. Install the NTS (non-thread safe) 64-bit version of PHP<\/strong><\/p>\n\n\n\n<p>Download and save onto the machine:<\/p>\n\n\n\n<p><a href=\"http:\/\/windows.php.net\/downloads\/releases\/php-7.x.x-nts-Win32-VC14-x64.zip\">http:\/\/windows.php.net\/downloads\/releases\/php-7.x.x-nts-Win32-VC14-x64.zip<\/a><\/p>\n\n\n\n<p>Extract all the contents of the zip file to C:\\PHP<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/jamesmccaffrey.wordpress.com\/2017\/01\/23\/installing-php-on-windows-10-and-iis\/02_unzip_php\/\"><img decoding=\"async\" src=\"https:\/\/jamesmccaffrey.files.wordpress.com\/2017\/01\/02_unzip_php.jpg?w=300&amp;h=156\" alt=\"02_unzip_php\" class=\"wp-image-5134\"\/><\/a><\/figure>\n\n\n\n<p>Now edit the System PATH variable so IIS knows where the PHP executables are:<\/p>\n\n\n\n<p>Control Panel | System and Security | System | Advanced System Settings<br>Environment Variables<br>System Variables | Path | Edit<br>New -&gt; C:\\PHP<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/jamesmccaffrey.wordpress.com\/2017\/01\/23\/installing-php-on-windows-10-and-iis\/03_edit_path_variable\/\"><img decoding=\"async\" src=\"https:\/\/jamesmccaffrey.files.wordpress.com\/2017\/01\/03_edit_path_variable.jpg?w=300&amp;h=259\" alt=\"03_edit_path_variable\" class=\"wp-image-5135\"\/><\/a><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>3. Configure the php.ini file. This is the part you\u2019d never figure out without some help.<\/strong><\/p>\n\n\n\n<p>Make a copy of file C:\\PHP\\php.ini-development and save it as C:\\PHP\\php.ini<\/p>\n\n\n\n<p>Edit file php.ini by finding the following entries, uncomment them, and change values to:<\/p>\n\n\n\n<p>1. fastcgi.impersonate = 1<br>2. cgi.fix_pathinfo = 0<br>3. cgi.force_redirect = 0<br>4. open_basedir = \u201cC:\\inetpub\\wwwroot\u201d<br>5. extension_dir = \u201cext\u201d<br>6. error_log=\u201dphp_errors.log\u201d<br>7. uncomment the 24 Windows Extensions entries:<\/p>\n\n\n\n<p>extension=php_bz2.dll<br>extension=php_curl.dll<br>extension=php_fileinfo.dll<br>extension=php_ftp.dll<br>extension=php_gd2.dll<br>extension=php_gettext.dll<br>extension=php_gmp.dll<br>extension=php_intl.dll<br>extension=php_imap.dll<br>extension=php_interbase.dll<br>extension=php_ldap.dll<br>extension=php_mbstring.dll<br>extension=php_exif.dll<br>extension=php_mysqli.dll<br>extension=php_oci8_12c.dll<br>extension=php_openssl.dll<br>extension=php_pdo_firebird.dll<br>extension=php_pdo_mysql.dll<br>extension=php_pdo_oci.dll<br>extension=php_pdo_odbc.dll<br>extension=php_pdo_pgsql.dll<br>extension=php_pdo_sqlite.dll<br>extension=php_pgsql.dll<br>extension=php_shmop.dll<\/p>\n\n\n\n<p>Save the edited php.ini file.<\/p>\n\n\n\n<p><strong>4. Configure IIS to work with PHP<\/strong><\/p>\n\n\n\n<p>Run | inetmgr<br>Handler Mappings | Add Module Mapping<\/p>\n\n\n\n<p>Request path: *.php<br>Module: FastCgiModule (from the dropdown)<br>Executable (optional): C:\\PHP\\php-cgi.exe<br>Name: FastCGI<\/p>\n\n\n\n<p>OK (Yes)<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/jamesmccaffrey.wordpress.com\/2017\/01\/23\/installing-php-on-windows-10-and-iis\/04_iis_handler_mappings\/\"><img decoding=\"async\" src=\"https:\/\/jamesmccaffrey.files.wordpress.com\/2017\/01\/04_iis_handler_mappings.jpg?w=300&amp;h=204\" alt=\"04_iis_handler_mappings\" class=\"wp-image-5136\"\/><\/a><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>5. Test the installation and configuration<\/strong><\/p>\n\n\n\n<p>Launch Notepad with Administrative privleges. Create a file test.php and save it at C:\\inetpub\\wwwroot. The contents are (I use an image because my blog software would choke on HTML text):<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/jamesmccaffrey.wordpress.com\/2017\/01\/23\/installing-php-on-windows-10-and-iis\/file_test_php\/\"><img decoding=\"async\" src=\"https:\/\/jamesmccaffrey.files.wordpress.com\/2017\/01\/file_test_php.jpg?w=300&amp;h=205\" alt=\"file_test_php\" class=\"wp-image-5141\"\/><\/a><\/figure>\n\n\n\n<p>Now launch a browser and navigate to<\/p>\n\n\n\n<p><a href=\"http:\/\/localhost\/test.php\">http:\/\/localhost\/test.php<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/jamesmccaffrey.wordpress.com\/2017\/01\/23\/installing-php-on-windows-10-and-iis\/05_testing\/\"><img decoding=\"async\" src=\"https:\/\/jamesmccaffrey.files.wordpress.com\/2017\/01\/05_testing.jpg?w=300&amp;h=185\" alt=\"05_testing\" class=\"wp-image-5137\"\/><\/a><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>1. Configure IIS Control Panel | Programs | Turn Windows features on or off Check Internet Information ServicesCheck IIS | World Wide Web Services | Application Development Features | CGIOK 2. Install the NTS (non-thread safe) 64-bit version of PHP &hellip; <a href=\"https:\/\/blog.iabsolute.com\/?p=605\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37],"tags":[],"class_list":["post-605","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=\/wp\/v2\/posts\/605","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=605"}],"version-history":[{"count":1,"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=\/wp\/v2\/posts\/605\/revisions"}],"predecessor-version":[{"id":606,"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=\/wp\/v2\/posts\/605\/revisions\/606"}],"wp:attachment":[{"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=605"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=605"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=605"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}