Jump to content


Photo

installing php5 om Apache 2


  • Please log in to reply
1 reply to this topic

#1 David-fethiye

David-fethiye
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 11 May 2006 - 12:39 PM


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.

(instructions)
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)

Thanks.

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 11 May 2006 - 12:52 PM

Are you on Windows. If you are the following these instructions:

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.

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

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

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

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:
<?php

echo "Hello world";

?>






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users