Question

installing php on apache

Asked by: jdav3579

Hi 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.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2006-02-10 at 10:14:40ID21732051
Tags

apache

,

php

Topic

PHP Installation

Participating Experts
3
Points
300
Comments
23

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

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.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

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.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

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.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. PHP with Apache Server?
    Hi, I installed apache and put my php in apache Folder. When i am typing the url in the IE address bar it is showing the php correctly. When i am trying to refresh the same php file IE was showing the php code. So please help me. Any configuration Needed. Srinivas
  2. Red Hat 8.0 PHP httpd.conf question
    I am setting up RH8.0 and can not get the httpd to run php. When settign up httpd.conf file I get errors on the LoadModule statements saying it is not compatible? What statements do I need using RH8.0 and apache 1.3 to get php to run under httpd? Thanks
  3. httpd.conf
    Hi, I have just installed apache2 for the umpteenth time...and I am trying to configure it for php...I am on a windows2k pro machine, And the php4ts.dll file is in the php folder C:/php and the httpd.conf file is in C:/program files/apache group/apache2/conf Can anyobne p...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

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.

Join the Community

Answers

 

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.

 

by: jstretchPosted on 2006-02-10 at 12:37:43ID: 15926375

 

by: jdav3579Posted on 2006-02-11 at 16:40:59ID: 15932742

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


 

 

by: redecsPosted on 2006-02-13 at 15:59:47ID: 15946826

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.

 

by: jstretchPosted on 2006-02-13 at 16:17:45ID: 15947066

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).

 

by: jstretchPosted on 2006-02-13 at 16:19:35ID: 15947074

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/downloads.php

 

by: redecsPosted on 2006-02-13 at 16:25:26ID: 15947105

I forgot the php.ini part. Any way i advise you to let the newly php.ini file in your php dir, and point apache to search in that directory. It will save you from some php upgrade problems.

Another thing about the installer it is that does not come with all the libraries you may need.

 

by: jdav3579Posted on 2006-02-14 at 09:51:05ID: 15953046

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

 

by: jstretchPosted on 2006-02-14 at 12:18:21ID: 15954353

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.dll"
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

 

by: jdav3579Posted on 2006-02-14 at 12:33:56ID: 15954504

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

 

by: jstretchPosted on 2006-02-14 at 12:38:08ID: 15954553

Check your event viewer for an error: Control Panel -> Admin Tools -> Event Viewer -> Application

Also check your apache log:
D:/apache/log/error.log

Paste whatever you find here...

 

by: jdav3579Posted on 2006-02-14 at 12:51:53ID: 15954703

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....

 

by: jdav3579Posted on 2006-02-14 at 12:53:46ID: 15954719

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.  

 

by: jstretchPosted on 2006-02-14 at 13:07:21ID: 15954856

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

 

by: jdav3579Posted on 2006-02-14 at 17:03:12ID: 15956774

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/fwlink/events.asp.

I have changed the folder name to lowercase and all reference to it are lowercase now as well.

Cheers
John

 

by: jstretchPosted on 2006-02-14 at 19:24:19ID: 15957456

Try using the backslashes instead:

LoadModule php5_module "d:\php\php5apache2.dll"

 

by: redecsPosted on 2006-02-14 at 23:56:28ID: 15958322

Apache doesn't work with backslashes. Are u sure that the path to the file is corect?

 

by: LinuxNubbPosted on 2006-02-15 at 07:30:30ID: 15961033

it will work fine if you double backslash, or single forwards slash:

LoadModule php5_module "d:\\php\\php5apache2.dll"

LoadModule php5_module "d:/php/php5apache2.dll"

 

by: jdav3579Posted on 2006-02-15 at 09:10:42ID: 15962354

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

 

by: jstretchPosted on 2006-02-15 at 13:25:49ID: 15965079

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.

 

by: jdav3579Posted on 2006-02-15 at 13:42:07ID: 15965260

Tried doing it without quotes, but it still kept turning itself off when i tried to restart it!
The apache logs yielded only the other problems I had, it did not mention this current one!
Thank you for all your help.
John

 

by: redecsPosted on 2006-02-15 at 13:52:56ID: 15965377

There is something really wierd with your apache! I had some problems when trying to install php (with some extensions), but it never turned itself off...

 

by: jdav3579Posted on 2006-02-15 at 14:05:32ID: 15965533

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

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...