Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I've successfully installed Apache 2.2.22 and I ran the localhost and I got the It works message so I'm assuming that is ok.

Then I installed PHP 5.3.15. My question is how do I make those two work together? Edit some configuration, copy some file somewhere or?

I didn't do this in years, it used to be while you were installing PHP you'd be prompted in your installation which webserver you were using than you'd choose the correct version and then where the config directory is.

Than you'd restart your webserver and would have the whole thing working.

share|improve this question

closed as off topic by John Gardeniers, Lucas Kauffman, Michael Hampton, Ward, rnxrx Aug 25 '12 at 6:02

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers 2

If you want to run Apache 2.2/PHP 5.3 on Windows, you'll need the VC9 build, not the version from apache.org. You'll also need the thread safe VC9 build of PHP. This isn't as straightforward as it used to be! So, from the start:

  • Download httpd-2.2.22-win32-ssl_0.9.8.zip from http://www.apachelounge.com/download/
  • Copy Apache2 folder from httpd-2.2.22-win32-ssl_0.9.8.zip to C:/
  • Open C:/Apache2/conf/httpd.conf in Notepad. Add:
LoadModule php5_module "C:/Program Files (x86)/PHP/php5apache2_2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/Program Files (x86)/PHP/"
  • Create a shortcut of C:/Apache2/bin/ApacheMonitor.exe in your startup folder.
  • Download PHP 5.3 (5.3.14) VC9 x86 thread safe Zip from http://windows.php.net/download/
  • Copy all from php-5.3.13-Win32-VC9-x86.zip to C:/Program Files (x86)/PHP
  • Copy C:/Program Files (x86)/PHP/php.ini-development to C:/Program Files (x86)/PHP/php.ini
  • Uncomment extension_dir = "./ext" in php.ini

From Windows 7 start menu, search for 'run', select the 'run' app, and paste in:

"C:/Apache2/bin/httpd.exe" -k install

Then go to Control panel > All control panel items > Administrative tools > Services > Apache2.2: Start

Add the path to PHP to the end of your Path system variables in My computer > Properties > Advanced system settings > Environmental variables

Then run ApacheMonitor.exe, restart Apache2, and you should be good to go.

share|improve this answer
    
I see you edited it back to original. However, the bug mentioned has already been fixed 9 months ago. And this line is still wrong: "C:/Apache2/bin/httpd.exe" -k install should be "C:\Apache2\bin\httpd.exe" -k install –  Frederik Nielsen Jul 23 '12 at 14:51
    
Hi Frederick, I've restored it to the version I've used and tested on two different Windows 7 x64 PCs in the last fortnight. I've tested it again before typing this, and my original code worked 100%. –  jetboy Jul 23 '12 at 19:36
    
Allright, forward slashes do work in the run command, however, best practice would be to use backslash in windows, as that is the default. –  Frederik Nielsen Jul 24 '12 at 6:29

Solution I downloaded PHP 5.2.6 and I was prompted for apache location and the config was updated.

I know what was supposed to get updated but previous (newer) installation of PHP didn't build me a right .dll file so I can include it in the httpd.conf

share|improve this answer
1  
That's not a solution. That's a poor workaround which doesn't give you the results your questions asked about. –  John Gardeniers Jul 20 '12 at 13:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.