{"id":170,"date":"2012-11-04T14:21:37","date_gmt":"2012-11-04T04:21:37","guid":{"rendered":"http:\/\/www.alphastar.net.au\/blog\/?p=170"},"modified":"2012-11-04T14:24:46","modified_gmt":"2012-11-04T04:24:46","slug":"php-and-apache-on-windows-7","status":"publish","type":"post","link":"https:\/\/alphastar.net.au\/weblog\/2012\/11\/04\/php-and-apache-on-windows-7\/","title":{"rendered":"PHP and Apache on Windows 7"},"content":{"rendered":"<p style=\"text-align: justify;\">Installing Apache webserver and PHP together on Windows 7 proved to be more cumbersome than it should be. I had seen this error many times when starting Apache.<\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #ff0000;\">&#8220;The requested operation has failed&#8221;<\/span><\/p>\n<p style=\"text-align: justify;\">I went through many different versions of Apache and PHP until I hit the right combination, which I now going to document here.<\/p>\n<p style=\"text-align: justify;\"><!--more--><\/p>\n<p style=\"text-align: justify;\"><span style=\"text-decoration: underline;\">Install PHP<\/span><\/p>\n<p style=\"text-align: justify;\">This PHP is a manual installation.<\/p>\n<p><strong>php-5.2.17-Win32-VC6-x86.zip<\/strong><\/p>\n<p>copy the sample php.ini-recommended to php.ini<\/p>\n<p>If necessary point to the ext directory (PHP defaults to the current directory unless you change it)<\/p>\n<p>[code]<\/p>\n<p>extension_dir=&#8221;C:\\php\\ext&#8221;<\/p>\n<p>[\/code]<\/p>\n<p>I am not using an installer, so modifications will need to be made to the Apache config file (httpd.conf)<span style=\"text-decoration: underline;\"> <\/span>so that Apache knows of PHP&#8217;s existence.<\/p>\n<p><span style=\"text-decoration: underline;\">Install Apache<\/span><\/p>\n<p><strong>httpd-2.2.21-win32-x86-no_ssl.msi<\/strong><\/p>\n<p>and modify the contents with the following (of course &#8216;&#8230;&#8217; is not part of the config file. just put the lines in the correct areas of the file.)<\/p>\n<p>[code]<\/p>\n<p>LoadModule php5_module &#8220;c:\/php\/php5apache2_2.dll&#8221;<\/p>\n<p>&#8230;<\/p>\n<p>&lt;IfModule dir_module&gt;<br \/>\nDirectoryIndex index.html index.php<br \/>\n&lt;\/IfModule&gt;<\/p>\n<p>&#8230;<\/p>\n<p>AddHandler application\/x-httpd-php .php<\/p>\n<p>&#8230;<\/p>\n<p># configure the path to php.ini<br \/>\nPHPIniDir &#8220;C:\/php&#8221;<\/p>\n<p>[\/code]<\/p>\n<p>create a test page (phpinfo.php) and put it in the htdocs. If you see output, PHP is installed correctly!<\/p>\n<p>[code]<\/p>\n<p>&lt;?php phpinfo(); ?&gt;<\/p>\n<p>[\/code]<\/p>\n<p>If all else fails run<\/p>\n<p>httpd -e debug<\/p>\n<p>from the console and view the output. It will usually tell you which module it is unable to load.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Installing Apache webserver and PHP together on Windows 7 proved to be more cumbersome than it should be. I had seen this error many times when starting Apache. &#8220;The requested&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-170","post","type-post","status-publish","format-standard","hentry","category-coding"],"_links":{"self":[{"href":"https:\/\/alphastar.net.au\/weblog\/wp-json\/wp\/v2\/posts\/170","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alphastar.net.au\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alphastar.net.au\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alphastar.net.au\/weblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alphastar.net.au\/weblog\/wp-json\/wp\/v2\/comments?post=170"}],"version-history":[{"count":27,"href":"https:\/\/alphastar.net.au\/weblog\/wp-json\/wp\/v2\/posts\/170\/revisions"}],"predecessor-version":[{"id":199,"href":"https:\/\/alphastar.net.au\/weblog\/wp-json\/wp\/v2\/posts\/170\/revisions\/199"}],"wp:attachment":[{"href":"https:\/\/alphastar.net.au\/weblog\/wp-json\/wp\/v2\/media?parent=170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alphastar.net.au\/weblog\/wp-json\/wp\/v2\/categories?post=170"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alphastar.net.au\/weblog\/wp-json\/wp\/v2\/tags?post=170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}