{"id":677,"date":"2012-05-02T21:04:39","date_gmt":"2012-05-02T21:04:39","guid":{"rendered":"http:\/\/microsoftgeek.com\/?p=677"},"modified":"2012-05-02T21:04:39","modified_gmt":"2012-05-02T21:04:39","slug":"how-do-i-install-php-on-a-windows-server","status":"publish","type":"post","link":"https:\/\/microsoftgeek.com\/?p=677","title":{"rendered":"How do I install PHP on a Windows Server?"},"content":{"rendered":"<p>The following article explains how to install PHP on a Windows Server running IIS 6. The process involves downloading the latest version of PHP directly to your Windows server and then installing the software. PHP is a free product.<\/p>\n<h2>To install PHP, please follow these steps:<\/h2>\n<ol>\n<li>Log into your server through Terminal Services or Remote Desktop Connection.<\/li>\n<li>Open a Web browser and load <a href=\"http:\/\/www.php.net\/downloads.php\" target=\"_blank\">http:\/\/www.php.net\/downloads.php<\/a><\/li>\n<li>Download the <strong>Windows PHP5.x ZIP package<\/strong>.<\/li>\n<li>Create a new directory, <strong>c:\\PHP<\/strong>.<\/li>\n<li>Unzip the file you downloaded above into c:\\PHP.<\/li>\n<li>Create a new directory, <strong>C:\\PHP\\phpsessions<\/strong>.<\/li>\n<li>Right click the <strong>C:\\PHP<\/strong> folder and select <strong>Properties<\/strong>.<\/li>\n<li>On the <strong>Security Tab<\/strong> click <strong>Add<\/strong>.<\/li>\n<li>Type <strong>IUSR_<em>COMPUTERNAME<\/em><\/strong> (where computer name is the name of your computer) in the text area, click <strong>Check Names<\/strong> and then click <strong>OK<\/strong>. <img decoding=\"async\" src=\"http:\/\/www.hosting.com\/support\/dedicated\/general\/installphp\/images\/installphp1.jpg\" alt=\"\" \/><\/li>\n<li>Select the <strong>IUSR_<em>COMPUTERNAME<\/em><\/strong> user, check the <strong>Full Control<\/strong> box and click <strong>OK<\/strong>. <img decoding=\"async\" src=\"http:\/\/www.hosting.com\/support\/dedicated\/general\/installphp\/images\/installphp2.jpg\" alt=\"\" \/><\/li>\n<li>Open <strong>C:\\PHP\\php.ini-dist<\/strong> in <strong>Notepad<\/strong>.<\/li>\n<li>Within the file, make the following replacements:\n<ul>\n<li>Replace <strong>;extension=php_mysql.dll<\/strong> with <strong>extension=php_mysql.dll<\/strong><\/li>\n<li>Replace <strong>;session.save_path = &#8220;\/tmp&#8221;<\/strong> with <strong>session.save_path = &#8220;C:\\PHP\\phpsessions&#8221;<\/strong><\/li>\n<li>Replace <strong>session.gc_maxlifetime = 1440<\/strong> with <strong>session.gc_maxlifetime = 43200<\/strong><\/li>\n<li>Replace <strong>SMTP = localhost<\/strong> with <strong>SMTP = smtp.yourdomain.com<\/strong><\/li>\n<li>Replace <strong>;sendmail_from = me@example.com<\/strong> with <strong>sendmail_from = user@yourdomain.com<\/strong><\/li>\n<\/ul>\n<\/li>\n<li>Save the file as <strong>C:\\windows\\php.ini<\/strong>.<\/li>\n<li>Copy <strong>C:\\PHP\\libmysql.dll<\/strong> and <strong>C:\\PHP\\ext\\php_mysql.dll<\/strong> to the <strong>C:\\windows\\system32<\/strong> folder.<\/li>\n<li>Open <strong>IIS<\/strong> located under <strong>Control Panel<\/strong> -&gt; <strong>Administrative Tools<\/strong> -&gt; <strong>Internet Information Services (IIS) Manager<\/strong>.<\/li>\n<li>Right click <strong>Web Service Extensions<\/strong> and select <strong>Add a new Web service extension<\/strong>. <img decoding=\"async\" src=\"http:\/\/www.hosting.com\/support\/dedicated\/general\/installphp\/images\/installphp3.jpg\" alt=\"\" \/><\/li>\n<li>Enter <strong>php<\/strong> as the <strong>Extension Name<\/strong>, check <strong>Set extension status to Allowed<\/strong> and Click <strong>Add<\/strong>. <img decoding=\"async\" src=\"http:\/\/www.hosting.com\/support\/dedicated\/general\/installphp\/images\/installphp4.jpg\" alt=\"\" \/><\/li>\n<li>Enter the path to <strong>C:\\PHP\\php5isapi.dll<\/strong> and click <strong>OK<\/strong>. <img decoding=\"async\" src=\"http:\/\/www.hosting.com\/support\/dedicated\/general\/installphp\/images\/installphp5.jpg\" alt=\"\" \/><\/li>\n<li>Right click <strong>Web Sites<\/strong> and select <strong>Properties<\/strong>. <img decoding=\"async\" src=\"http:\/\/www.hosting.com\/support\/dedicated\/general\/installphp\/images\/installphp6.jpg\" alt=\"\" \/><\/li>\n<li>On the <strong>ISAPI Filters<\/strong> tab, click <strong>Add<\/strong>.<\/li>\n<li>Enter <strong>php<\/strong> as the <strong>Filter Name<\/strong>, enter <strong>C:\\PHP\\php5isapi.dll<\/strong> as the <strong>Executable<\/strong> and click <strong>OK<\/strong>. <img decoding=\"async\" src=\"http:\/\/www.hosting.com\/support\/dedicated\/general\/installphp\/images\/installphp7.jpg\" alt=\"\" \/><\/li>\n<li>On the <strong>Home Directory<\/strong> tab, click <strong>Configuration<\/strong>.<\/li>\n<li>Click <strong>Add<\/strong>.<\/li>\n<li>Enter <strong>C:\\PHP\\php5isapi.dll<\/strong> as the <strong>Executable<\/strong>, enter <strong>php<\/strong> as the <strong>Extension<\/strong> and click <strong>OK<\/strong>. <img decoding=\"async\" src=\"http:\/\/www.hosting.com\/support\/dedicated\/general\/installphp\/images\/installphp8.jpg\" alt=\"\" \/><\/li>\n<li>On the <strong>Documents<\/strong> Tab, click <strong>Add<\/strong>.<\/li>\n<li>Enter <strong>index.php<\/strong> and click <strong>OK<\/strong>. <img decoding=\"async\" src=\"http:\/\/www.hosting.com\/support\/dedicated\/general\/installphp\/images\/installphp9.jpg\" alt=\"\" \/><\/li>\n<li>A popup box may appear asking if you want to apply the settings to certain websites. Choose specific websites to enable PHP on or Select All and click <strong>OK<\/strong>.<\/li>\n<li>Right click your <strong>Computer Name<\/strong>, expand <strong>All Tasks<\/strong> and click <strong>Restart IIS<\/strong>. <img decoding=\"async\" src=\"http:\/\/www.hosting.com\/support\/dedicated\/general\/installphp\/images\/installphp10.jpg\" alt=\"\" \/><\/li>\n<li>Choose <strong>Restart IIS<\/strong> from the dropdown menu and click <strong>OK<\/strong>. <img decoding=\"async\" src=\"http:\/\/www.hosting.com\/support\/dedicated\/general\/installphp\/images\/installphp11.jpg\" alt=\"\" \/><\/li>\n<\/ol>\n<h2>To test your installation of PHP, please follow these steps:<\/h2>\n<ol>\n<li>Open up Notepad and create a new document.<\/li>\n<li>Add the following text into your new document: <strong>&lt;?php phpinfo(); ?&gt;<\/strong><\/li>\n<li>Save this new file to your website root as <strong>phpinfo.php<\/strong>.<\/li>\n<li>In a Web browser, navigate to <strong>phpinfo.php<\/strong>.<\/li>\n<\/ol>\n<p>You should have an output screen of all of the information regarding PHP for your server.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The following article explains how to install PHP on a Windows Server running IIS 6. The process involves downloading the latest version of PHP directly to your Windows server and then installing the software. PHP is a free product. To install PHP, please follow these steps: Log into your server through Terminal Services or Remote [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36,4],"tags":[],"class_list":["post-677","post","type-post","status-publish","format-standard","hentry","category-iis-internet-information-services","category-general-2003-stuff"],"_links":{"self":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/677","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=677"}],"version-history":[{"count":1,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/677\/revisions"}],"predecessor-version":[{"id":678,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/677\/revisions\/678"}],"wp:attachment":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=677"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=677"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=677"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}