Main Topics
Browse All TopicsHi Experts,
I have just downloaded and installed apache on my windows xp computer. It works. I have been searching around looking for a guide to setting php up on it. I know how to get to the httpd.conf file, I just dont know if I need to download more things from php.net, or how to set it up... any ideas?
Cheers
John
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Thank you both for your comments. I have never attempted this before, so am very much out of my depth.
jstretch, I have followed the tutorial at the website but I think it is quite old.
I downloaded version 5 of php.
It says that I should extract it to C:\Program Files\Apache Group\Apache2 , on my system, I saved it on D drive and the folder it gave me was d:\Apache, not d:\apache group etc...
Regardless I extracted it to d:\Apache. it asked me what platform, bearing in mind I am running xp but have installed apache, I selected apache as the platform. The next instruction was to "copy the file php.ini-dist in PHP directory to you windows directory" unfortunately I could not find this file either.
It also said that php should have created a new directory which I should rename PHP, but it never...
Am sorry if all this sounds quite basic to you, I just have never done this sort of stuff before..
Cheers.
John
The easy way: Get the installer version of PHP. In most cases it will work. (in your case you must indicate the path to the webserver when instaling, because it's not the default one).
The manual way (Apache module): Get the zip, unpack it (D:\php, for example),
then go to D:\apache\Apache2\conf, open httpd.conf and add the folowing lines at the end
LoadModule php5_module "D:/php/php5apache2.dll"
AddType application/x-httpd-php .php
# optional, but recommended
PHPIniDir "D:/php"
Restart apache, and you should have php support in your webserver now.
After installing php you will find your php.ini-dist in the folder you installed to. Copy this file to C:\WINDOWS and rename it to php.ini...then restart your service as jdav suggested above. To restart the service go to your control panel, administrative tools, and double click services. In that list you will find Apache or Apache2...click on that and then click restart (or start).
Heres the link for downloading php..you want to download and run Windows Binary Php 5.1.2 Installer. Dont hesitate if you have more problems.
http://www.php.net/downloa
Thanks both of you.
Redecs, I tried installing it the manual way. I created a new folder on d:/ called php. I used winzip to unzip the php zip file and copied the contents into my php folder on d:/
I then went to httpd.conf of apache and put this in:
LoadModule php5_module "D:/php/php5apache2.dll"
AddType application/x-httpd-php .php
# optional, but recommended
PHPIniDir "D:/php"
as it is. When I restarted apache it turned itself off and wouldnt restart until I had removed those lines of code.
Also I am not quite sure what your last comment means as well..
Thanks to you both.
John
It probably turned itself off because of errors. I'm guessing you installed php on your C drive? If so you need to change those lines of code to reflect that. If you installed php to e:/php-5.0.1 for example, then you would have to use these lines in httpd.conf:
LoadModule php5_module "e:/php-5.0.1/php5apache2.
AddType application/x-httpd-php .php
PHPIniDir "e:/php-5.0.1"
To recap:
- Install Apache
- Install PHP
- Add lines of code to httpd.conf
- Make sure php.ini exists either in C:\WINDOWS Or whever PHPIniDir specifies (in this example e:/php-5.0.1/php.ini)
- Start or Restart apache service
PHP folder and Apache are both coincidentally on my D:\ drive. I found that in the code in previous comments it was written d:\php and my folder is in capitals d:\PHP, so I have changed it in the code below.....
LoadModule php5_module "D:/PHP/php5apache2.dll"
AddType application/x-httpd-php .php
# optional, but recommended
PHPIniDir "D:/PHP"
I found two php.ini, one was php.ini-dist and the other php.ini-recommended, so I renamed the recommended one as php.ini and left it in d:\PHP..
I have done all this and restarted apache but it just turned itself off again.
Cheers
John
The Apache service named Apache.exe reported the following error:
>>> Cannot load d:/php/php5apache2.dll into server: (126) The specified module could not be found: <<<
before the error.log file could be opened.
More information may be available in the error.log file.
I notice it uses lower case, but in my httpd.conf file it is uppercase....
I just changed it all to lowercase.. but to no avail
just said this:
The Apache service named Apache.exe reported the following error:
>>> Cannot load d:/php/php5apache2.dll into server: (126) The specified module could not be found: <<<
before the error.log file could be opened.
More information may be available in the error.log file.
Keep it UPPER if your folder is D:\PHP
This error means it didn't see the php5apache2.dll file. Look in your D:\PHP folder for this file or something similar. If you find the file in a directory other than D:\PHP, then just copy it to D:\PHP and restart your service.
One more thing, maybe you have php4 installed?
# For PHP 4 do something like this:
LoadModule php4_module "D:/PHP/php4apache2.dll"
# Don't forget to copy the php4apache2.dll file from the sapi directory!
AddType application/x-httpd-php .php
# For PHP 5 do something like this:
LoadModule php5_module "D:/PHP/php5apache2.dll"
AddType application/x-httpd-php .php
Hi,
I typed d:/php/php5apache2.dll into my web browser and it went straight to the file...
When I changed stuff in httpd.conf file it just still came up with this error..
Event Type: Error
Event Source: Apache Service
Event Category: None
Event ID: 3299
Date: 15/02/2006
Time: 00:55:36
User: N/A
Computer: xxxx
Description:
The Apache service named Apache.exe reported the following error:
>>> Cannot load d:/php/php5apache2.dll into server: (126) The specified module could not be found: <<<
before the error.log file could be opened.
More information may be available in the error.log file. .
For more information, see Help and Support Center at http://go.microsoft.com/fw
I have changed the folder name to lowercase and all reference to it are lowercase now as well.
Cheers
John
Nope, just tried double backslashing but it still switched itself off.
As I say I typed the address of the file : d:/php/php5apache2.dll into the browser and it went straight to it.
I also removed the stuff from the httpd.conf file and restarted and it restarted, so the problem must lie with :
# For PHP 5 do something like this:
LoadModule php5_module "D:/PHP/php5apache2.dll"
AddType application/x-httpd-php .php
One last thing, try doing it without quotes...use forward slashes again, and make sure everything is in the right case (upper/lower?):
# For PHP 5 do something like this:
LoadModule php5_module D:\php\php5apache2.dll
AddType application/x-httpd-php .php
Also, did the error.log provide any further details on the error?
Its found in D:\Apache\logs\error.log
Open it with notepad and scroll to the end of the file.
A message box appears when i click start service saying "The Apache service on local computer started then stopped, some services stop if they have no work to do, for example, the performance logs and alerts"
I just ok that box and thats it! It just gives me the option to start the service...
Thanks for your help! i will leave the question open for a little longer, in case anyone thinks of anything.
Cheers.
John
Business Accounts
Answer for Membership
by: LinuxNubbPosted on 2006-02-10 at 11:06:44ID: 15925494
Have you downloaded anything from php.net? You'll need the win32 zip file and the win32 installer. Run the installer first. Then afterwards extract the contents of the zip file into the newly created php directory.