{"id":1800,"date":"2017-07-13T13:23:05","date_gmt":"2017-07-13T07:53:05","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=1800"},"modified":"2026-09-09T16:25:47","modified_gmt":"2026-09-09T10:55:47","slug":"php-installation-windows-server-2012","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/php-installation-windows-server-2012\/","title":{"rendered":"PHP Installation on Windows Server 2012"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This guide explains how to install PHP on Windows Server 2012, running under IIS (Internet Information Services), so you can host PHP-based applications like WordPress, phpMyAdmin, or custom PHP sites.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you&#8217;ve seen older tutorials recommending the Microsoft Web Platform Installer (WebPI) for this: WebPI was officially retired by Microsoft, with its package feed shut down completely on December 31, 2022. It can no longer be used. This guide covers the current, correct method \u2014 installing PHP manually and registering it with IIS via FastCGI.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It&#8217;s also worth noting that Windows Server 2012 itself reached end of Extended Support in October 2023, meaning it no longer receives security updates. If you&#8217;re setting up a new server today, strongly consider a currently supported Windows Server version instead \u2014 Section II covers this in more detail.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Implementation<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">I. Prerequisites<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Before you install PHP on Windows Server 2012, make sure you have:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Administrative access to the server<\/li>\n\n\n\n<li>IIS installed, or willingness to install it as part of this guide<\/li>\n\n\n\n<li>Basic familiarity with Server Manager and IIS Manager<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">II. Important: Windows Server 2012 End of Support<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Windows Server 2012 and 2012 R2 reached end of Extended Support on October 10, 2023 \u2014 Microsoft no longer releases security patches for the OS itself. If this is a new deployment, migrate to a currently supported Windows Server version (2019, 2022, or newer) before going further. If you&#8217;re maintaining an existing legacy system, the steps below remain accurate \u2014 just know the underlying OS carries elevated risk regardless of how well PHP is configured on top of it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">III. How PHP Runs Under IIS<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Unlike Apache, IIS doesn&#8217;t run PHP as a built-in module \u2014 it uses <strong>FastCGI<\/strong> to hand off requests to a separate PHP process:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A browser requests a <code>.php<\/code> file from IIS<\/li>\n\n\n\n<li>IIS&#8217;s FastCGI handler forwards the request to <code>php-cgi.exe<\/code><\/li>\n\n\n\n<li><code>php-cgi.exe<\/code> executes the script and returns rendered HTML<\/li>\n\n\n\n<li>IIS sends that output back to the browser<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2017\/07\/php_iis_fastcgi_architecture_v2-scaled.png\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"572\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2017\/07\/php_iis_fastcgi_architecture_v2-1024x572.png\" alt=\"\" class=\"wp-image-11576\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2017\/07\/php_iis_fastcgi_architecture_v2-1024x572.png 1024w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2017\/07\/php_iis_fastcgi_architecture_v2-300x168.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2017\/07\/php_iis_fastcgi_architecture_v2-768x429.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2017\/07\/php_iis_fastcgi_architecture_v2-1536x858.png 1536w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2017\/07\/php_iis_fastcgi_architecture_v2-2048x1144.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This is why the steps below both install IIS&#8217;s CGI feature and explicitly register <code>php-cgi.exe<\/code> as a handler.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">IV. Enable IIS and the CGI Feature<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open <strong>Server Manager<\/strong> \u2192 <strong>Add roles and features<\/strong><\/li>\n\n\n\n<li>Select <strong>Web Server (IIS)<\/strong> under server roles<\/li>\n\n\n\n<li>Under <strong>Application Development<\/strong>, check <strong>CGI<\/strong><\/li>\n\n\n\n<li>Complete the wizard<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">If IIS is already installed, add just the CGI feature the same way.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">V. Download and Extract PHP<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Since WebPI is no longer available, download PHP directly:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Go to the <a href=\"https:\/\/windows.php.net\/download\/\" target=\"_blank\" rel=\"noopener\">official PHP for Windows downloads page<\/a><\/li>\n\n\n\n<li>Choose the version your application requires (many current apps need PHP 8.x)<\/li>\n\n\n\n<li>Download the <strong>Non-Thread-Safe (NTS)<\/strong> build, x64<\/li>\n<\/ol>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Why NTS?<\/strong> Each FastCGI request runs as an independent PHP process rather than a shared thread, so Non-Thread-Safe is correct here. Thread-Safe builds are for different setups, like running PHP as an Apache module.<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">Extract the <strong>Zip<\/strong> package to a clean, space-free path:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">C:\\PHP\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Avoid <code>Program Files<\/code> \u2014 spaces in the path can cause PHP\/IIS configuration issues.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">VI. Configure php.ini<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Copy the production template:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">copy C:\\PHP\\php.ini-production C:\\PHP\\php.ini\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Edit <code>php.ini<\/code> and set at minimum:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>extension_dir = \"C:\\PHP\\ext\"<\/code><\/li>\n\n\n\n<li>Uncomment any extensions your app needs (<code>extension=mysqli<\/code>, <code>extension=curl<\/code>, <code>extension=gd<\/code>, etc.)<\/li>\n\n\n\n<li><code>cgi.fix_pathinfo=0<\/code> \u2014 more secure for IIS\/FastCGI<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">VII. Register PHP with IIS via FastCGI<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open <strong>IIS Manager<\/strong>, select your server name (not a specific site)<\/li>\n\n\n\n<li>Double-click <strong>Handler Mappings<\/strong> \u2192 <strong>Add Module Mapping<\/strong><\/li>\n\n\n\n<li>Set:\n<ul class=\"wp-block-list\">\n<li><strong>Request path:<\/strong> <code>*.php<\/code><\/li>\n\n\n\n<li><strong>Module:<\/strong> <code>FastCgiModule<\/code><\/li>\n\n\n\n<li><strong>Executable:<\/strong> <code>C:\\PHP\\php-cgi.exe<\/code><\/li>\n\n\n\n<li><strong>Name:<\/strong> <code>PHP via FastCGI<\/code><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Click <strong>OK<\/strong>, then <strong>Yes<\/strong> when prompted to create a FastCGI application<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">VIII. Set the Default Document (Optional)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In IIS Manager, select your site \u2192 <strong>Default Document<\/strong> \u2192 <strong>Add<\/strong> \u2192 enter <code>index.php<\/code>. Move it above <code>index.html<\/code> if you want it prioritized.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">IX. Test and Verify<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Place a test file at:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">C:\\inetpub\\wwwroot\\info.php\n<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nphpinfo();\n?>\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Visit <code>http:\/\/localhost\/info.php<\/code> \u2014 you should see PHP&#8217;s configuration page.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Security note:<\/strong> Delete or restrict access to <code>info.php<\/code> once confirmed working \u2014 it exposes detailed server info useful to an attacker if left public.<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">X. Troubleshooting Common Issues<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>&#8220;Not Found&#8221; or a download prompt instead of the page rendering:<\/strong> Handler Mapping wasn&#8217;t saved correctly, or the FastCGI application wasn&#8217;t created \u2014 revisit Step VII.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>500 Internal Server Error:<\/strong> Check the <code>php-cgi.exe<\/code> path for typos, and confirm <code>php.ini<\/code> sits in the same folder as <code>php-cgi.exe<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>A PHP function or extension seems missing:<\/strong> Revisit Step VI \u2014 confirm the extension is uncommented and <code>extension_dir<\/code> is correct.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Changes to php.ini don&#8217;t take effect:<\/strong> Run <code>iisreset<\/code> from an elevated command prompt to force FastCGI to pick up the change.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">XI. Application Pool Permissions<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If your app needs to write files (uploads, cache), grant its Application Pool identity access to just those specific folders:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Right-click the folder \u2192 <strong>Properties \u2192 Security \u2192 Edit \u2192 Add<\/strong><\/li>\n\n\n\n<li>Add <code>IIS AppPool\\YourAppPoolName<\/code><\/li>\n\n\n\n<li>Grant <strong>Modify<\/strong> only where write access is genuinely needed<\/li>\n<\/ol>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Avoid granting broad permissions across your entire web root \u2014 scope access to just what&#8217;s needed.<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">XII. Conclusion<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Installing PHP on Windows Server 2012 today means skipping WebPI (retired) and instead enabling IIS&#8217;s CGI feature, downloading PHP directly, and registering it via FastCGI Handler Mappings. This gives full visibility over your PHP version and configuration \u2014 but with Windows Server 2012 past end-of-support, treat this as maintenance for an existing system rather than a foundation for something new.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For the latest PHP releases, see the <a href=\"https:\/\/windows.php.net\/\" target=\"_blank\" rel=\"noopener\">official PHP for Windows site<\/a>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently Asked Questions<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Can I still find and use the old Web Platform Installer somewhere?<\/strong> No \u2014 its package feed was shut down permanently on December 31, 2022, so even an old installer file wouldn&#8217;t be able to actually fetch or install anything.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Do I need Thread-Safe or Non-Thread-Safe PHP for IIS?<\/strong> Non-Thread-Safe (NTS) \u2014 the standard choice when running PHP under IIS via FastCGI.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Why use FastCGI instead of the old ISAPI module?<\/strong> ISAPI-based PHP was deprecated years ago and is no longer maintained. FastCGI is the current, supported method with better process isolation.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Talk to Our Technology Experts<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Managing a Windows Server environment or need help with web server configuration? Our team can help with server setup, security hardening, and ongoing support.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pheonixsolutions.com\/contact\">Connect with our technology experts.<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related Articles<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/managing-multiple-php-versions-on-ubuntu-using-apt\/\" target=\"_blank\" rel=\"noreferrer noopener\">Managing Multiple PHP Versions on Ubuntu Using APT<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-install-and-use-php-composer-on-centos-7\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Install and Use PHP Composer on CentOS 7<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction This guide explains how to install PHP on Windows Server 2012, running under IIS (Internet Information Services), so you [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1019],"tags":[],"class_list":["post-1800","post","type-post","status-publish","format-standard","hentry","category-cloud-aws","psol-cat-cloud-aws"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-t2","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1800","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=1800"}],"version-history":[{"count":3,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1800\/revisions"}],"predecessor-version":[{"id":11577,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1800\/revisions\/11577"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1800"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1800"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1800"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}