Jump to content

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.

(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.
Link to comment
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:
[code]#PHP5
# 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:
[code]<?php

echo "Hello world";

?>[/code]

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.