# [SOLVED] Getting PHP to work w/ Apache



## wheresmyres

Apache works fine, but when I edit the .conf file to include PHP then attempt to run Apache, it pops up and then closes just as quickly (I'm not running Apache as a service; doing so manually). If I comment out the php5 module and PHPIniDr lines, Apache runs just fine. There are no errors in my error.log.

Php portion of my httpd.conf file (I also added index.php to the ext list)


Code:


# PHP5 module
LoadModule php5_module "c:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
PHPIniDir "c:/php"

The PHP directory is located at c:\php and the file php5apache2_2.dll does exist in that directory. 

Not sure if it matters or not, but when I was reading up on setting up PHP with Apache on windows, every thing I found said to change the php.ini-recommend file to php.ini and the zip I downloaded does not have that file. It had php.ini-development & production. I changed php.ini-production to php.ini and edited that file instead. Is that correct?

I also found a similar thread on this forum which said after a reboot, Apache worked, but doing so for me changed nothing.


----------



## wheresmyres

*Re: Getting PHP to work w/ Apache*

Also:

I did add C:\php into my PATH variable; which did nothing. I've been searching google for answers, but keep coming up with similar results which have not made a difference. 

Running httpd -t in command prompt gives me this error (still no errors showing in my apache log, though)


Code:


C:\....\bin\httpd -t
httpd: Syntax error on line 489 of C:/..../conf/httpd.conf: 
Cannot load c:/php/php5apache2_2.dll into server: 
The application has failed to start because its side-by-side configuration
is incorrect. Please see the application even log for more details.


----------



## wheresmyres

*Re: Getting PHP to work w/ Apache*

I tried to edit, but got here too late.

Here's the error in my application log


Code:


Activation context generation failed for "C:\php\php5apache2_2.dll".
Dependent Assembly Microsoft.VC90.CRT,processorArchitecture="x86",
publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8"
 could not be found. Please use sxstrace.exe for detailed diagnosis.

I had trouble once before when trying to install a WAMP server, but it was only a minor config detail that held me up. I have no idea what the above means?


----------



## wheresmyres

*Re: Getting PHP to work w/ Apache*

I downloaded the Microsoft Visual C++ redistributable package for X86 arch, and all seems to be running well!


----------

