Jump to content


This topic is now archived and is closed to further replies.


installing php5 om Apache 2

Recommended Posts

After extracting the php5 files into my php directory ı need to modify the httpd.conf file

Trouble is these instruction (below) are for php4

can someone please tell me what i should replace them with for php5 ?

I have tried various guesses but Apache failed to start.

Modifying Apache Configuration

Apache doesn't know that you just install PHP. We need to tell Apache about PHP and where to find it. Open the Apache configuration file in C:\Program Files\Apache Group\Apache2\conf\httpd.conf and add the following three lines :

LoadModule php4_module php/sapi/php4apache2.dll
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

( end instructions)


Share this post

Link to post
Share on other sites
Are you on Windows. If you are the following these instructions:

[b]NOTE: with these steps I presume PHP is located in C:\php, make sure that you change any instances of C:\php to be changed to the correct path to where you have php located to.[/b]

Ok first open up your Apache configuration file (httpd.conf). Now scroll down and find the following line:
[code]#LoadModule ssl_module modules/mod_ssl.so[/code]
After that line add the following lines:
[code]#PHP 5
LoadModule php5_module "C:/php/php5apache2.dll"

# Location of the php.ini, PHP's configuration file.
PHPIniDir "C:/WINDOWS"[/code]

Now find the following line:
[code]AddType application/x-gzip .gz .tgz[/code]
Now after that line add the following lines:
# File extensions to be parsed by the PHP intepreter.
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-phps .phps[/code]

Now save the httpd.conf file and restart Apache.

That should now load PHP5 as an Apache module. You can test that everythink is working correctly by creating a simple hello world script:

echo "Hello world";


Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.