I am having trouble getting apache to load php. I got it running succesfully with a bit of effort 2 years ago but this is a fresh system so I am having to setup everything again… even though I kept some old config files for reference, I still cannot get php to load on apache.
I have apache-2.2.17 installed, works with various local websites(on computer), so apache works just fine.
I have extracted the php-5.3.6 extracted to c:\php
php5apache2_2.dll located in c:\php\php5apache2_2.dll
Now the next step is adding(to apache’s httpd.conf file):
LoadModule php5_module “c:/php/php5apache2_2.dll”
I added this to the end of my httpd.conf file, as I did on the last system and also tried adding it after the other LoadModule statements further up in the file… either way, when this line is added, apache fails to start.
Also in combination with:
Add the line just before the closing </IfModule> for that section.
AddType application/x-httpd-php .php
Add the following line to the end of your httpd.conf file.
PHPIniDir “c:/php”
apache still fails to start.
The main issue seems to be php5apache2_2.dll not loading for apache… the path is definetly correct and the file was in the php zip from the official site so the file is valid.
I have seen something about environment variables, but different guides say different things and I definetly don’t remember having to do this to get php to work on apache 2 years ago, so I don’t want to mess around with system stuff yet as I might do more damage than good… unless you think this is probably the way to solve this?
To further investigate…I have tried in command line to:
cd c:\Program Files (x86)\Apache Software Foundation\Apache2.2
apache
=*** apache is not recognized as an internal or external command
I thought this was meant to help me debug but as you can see it dosn’t work? Even though apache works since I can view local sites(when I take out the not working php stuff).
I am confused as to why apache won’t load the php module and why I can’t use apache command to debug.
I have been trying to start apache from gui at via taskbar… also if I command in cmd.exe:
net start apache2.2
=***apache service could not be started
a service specific error occured: 1
more help by typing NET HELPMSG 3547
I googled this error and found this:
Troubleshooting the Apache web server after changing configuration settings
If the Apache web server can’t be started after a change to a configuration file, open a command prompt (you don’t need Administrator rights), change the working directory to the Apache bin directory, and run apache.exe with the -t option:
cd “C:\Program Files\Apache Group\Apache2\bin”
C:\Program Files\Apache Group\Apache2\bin>apache -t
apache: could not open document config file C:/Program Files/Apache Group/Apache
2/conf/virtual-host.conf
tried apache2.2 directory, and it’s bin directory with commands:
apache
apache -t
apache.exe
all fail to be recognized -not internal or external command or batch file?