Forum Moderators: phranque

Message Too Old, No Replies

how to configure apache 2 to work with php5?

         

Diana86

10:01 pm on Dec 6, 2008 (gmt 0)

10+ Year Member



I read somewhere that I have to include the following lines in the httpd.conf file

ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php .phtml
Action application/x-httpd-php "/php/php.exe"

but i already did and it's not workin.

Anyango

8:32 am on Dec 7, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You also have to tell apache as to where your PHP is installed and how do you plan to use it, for example You can use it as Apache Module, for that you will have to tell apache to load its PHP Module. Use this, and change the path according to your machine

LoadModule php5_module "C:/Program Files/php-5.2.6-Win32/php5apache2_2.dll"
PHPIniDir "C:/Program Files/php-5.2.6-Win32/"

[edit]
both these commands go to httpd.conf, and restart apache after saving them. Also, PHPIniDir Command is not a compulsion

[edited by: Anyango at 8:33 am (utc) on Dec. 7, 2008]

Diana86

11:45 am on Dec 7, 2008 (gmt 0)

10+ Year Member



I did this step but still not workin:( do I have to change anything in the php.ini file?

Anyango

5:43 pm on Dec 7, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Can you tell us what is the error that you're getting ? is the php code showing when you click "view source" in your browser ?