NEWS CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
Home / News / Webmaster / Tips and Tricks

Tips and Tricks


Manually Configure PHP5 and Apache2

Install Web Server in Windows XP with Apache2 and PHP5

By Adrian Placinta, Web News Editor

16th of August 2007, 15:32 GMT

Adjust text size:



Enlarge picture
The easiest way to install PHP and Apache is to use software bundles like XAMPP, WAMP, Apache2Triad and many others. But many web developers prefer to install
everything manually.

So, the first step is to download the latest versions of the packages, for security reasons: PHP 5.2.3 and
Apache 2.2.4.

Installing Apache is easier if you download .msi package. Run the installation wizard and in the Server information window insert localhost at Network Domain and Server Name. In the same window, choose if you want to install Apache as a Service or if you want to start it manually. In the next windows choose typical installation, then choose the folder where you want to install Apache and so the installation is completed. By default, Apache's document root is set to htdocs directory. htdocs is located in C:/Program Files/Apache Software Foundation/Apache2.2/htdocs.

To install PHP, first you have to extract the PHP package to c:php. Rename php.ini-dist to php.ini and copy the file to windows folder: C:/Windows. PHP stores in php.ini all the configurations and if you want to install, for example, an extension, you will need to modify this file. Edit php.ini in WordPad and go to the 'Paths and Directories' section. Replace doc_root= withdoc_root = "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"

Now you have to configure Apache to work with PHP. Open httpd.conf file from "C:/Program Files/Apache Software Foundation/Apache2.2/conf". There you have to add:

CODE
LoadModule php5_module "c:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php

and also configure the path to php.ini and add this line:
CODE
PHPIniDir "C:/php/"

Save and close the file and restart Apache. To test the installation, paste the following code
CODE

to wordpad, rename it to phpinfo.php and copy it to htdocs folder. In your browser type: http://localhost/phpinfo.php and you should have a screen with Server related information and variables.

TAGS:

php | apache | phpinfo | install | configure


Rating:
Good (3.1/5) 7 vote(s) so far    

Read by 5,336 user(s) | Add comment | Link to this article
Subscribe to news | Print article | Send to friend

© Copyright 2001-2008 Softpedia
Contact:

 

 

SEARCH THE NEWS ARCHIVE :




Today's News
| Yesterday's News | News Archive


MORE RELATED ARTICLES:


Monitoring a Linux System with X11/Console/Web-Based Tools

Installing NTFS Write Support on Fedora/Ubuntu

Microsoft Finally A Winner, Beats The Vulnerable Apache

PHP 4 to Reach Its End-of-Life This Year

KDE 4.0 Beta 1 Available Now

User opinions:


Comment #1 by: Boony on 22 Aug 2007, 03:31 GMT reply to this comment

Thanks for that, I had been using Apache 2.0.59 due to 2.2 problems with PHP.

Just upgraded now I'm on PHP 5.2.3 and works great, I don't even have to move dlls around now when I upgrade PHP.

Just one thing I would like to add to your notes, that is, to remind people to add index.php to the directory index line in the config file to be :-
DirectoryIndex index.html index.php

Thanks again,
Boony


Comment #2 by: jaspal on 31 Aug 2008, 07:28 GMT reply to this comment

thanks for the info.....i m really glad...to see that help.....

and its working fine with me. Take care. God Bless ya


Comment #3 by: PRASHANT on 06 Oct 2008, 19:01 GMT reply to this comment

After configuring PHP5 and Apache 2.2 as per the settings above on localhost i m getting following error on IE

This error (HTTP 403 Forbidden) means that Internet Explorer was able to connect to the website, but it does not have permission to view the webpage.

Pl help.


Comment #4 by: morne on 11 Oct 2008, 12:56 GMT reply to this comment

Hi i have done the above but i still have this error can u please help


The website cannot display the page
HTTP 500
Most likely causes:
The website is under maintenance.
The website has a programming error.

What you can try:
Retype the address.

Go back to the previous page.

More information

This error (HTTP 500 Internal Server Error) means that the website you are visiting had a server problem which prevented the webpage from displaying.

For more information about HTTP errors, see Help.

Share your opinion:

Your Name:
Your Email Address:
(will not be used for commercial purposes)
Solve this to prove you're not a bot: =
Your review/opinion:

 






SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   ENTER NEWS SITE   |   ENGLISH BOARD   |   ROMANIAN FORUM