How to add php5 to apache?

Thread Solved

Join Date: Jul 2006
Posts: 138
Reputation: ryy705 is an unknown quantity at this point 
Solved Threads: 0
ryy705 ryy705 is offline Offline
Junior Poster

How to add php5 to apache?

 
0
  #1
Mar 19th, 2008
Hello,
I can run php scripts on my computer from the command prompt but I can't open it through my web browser. My assumption is that this happens because apache is not configured to use php.
Does anyone know what lines(s) I should add to apache's httpd.conf file? I found some examples online, but they all differ from one another(different versions, different tweaks, etc). I tried some of them, but none of them worked. What is the 'right' way to add php to apache? I am pasting the the fist paragraph generated by phpinfo(). Please let me know if any more information is required. Thanks.
PS. I am running ubuntu linux

phpinfo()
PHP Version => 5.2.1

System => Linux ryy 2.6.20-16-generic #2 SMP Tue Feb 12 05:41:34 UTC 2008 i686
Build Date => Nov 28 2007 23:13:02
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /etc/php5/cli/php.ini
Scan this dir for additional .ini files => /etc/php5/cli/conf.d
additional .ini files parsed => /etc/php5/cli/conf.d/mysql.ini,
/etc/php5/cli/conf.d/mysqli.ini,
/etc/php5/cli/conf.d/pdo.ini,
/etc/php5/cli/conf.d/pdo_mysql.ini
Last edited by ryy705; Mar 19th, 2008 at 12:45 pm.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 9
Reputation: WebManiac is an unknown quantity at this point 
Solved Threads: 1
WebManiac WebManiac is offline Offline
Newbie Poster

Re: How to add php5 to apache?

 
0
  #2
Mar 19th, 2008
The right way is obviously that decribed in the official PHP Manual:
http://www.php.net/manual/en/install.unix.php

There are 2 most important points:

1. Apache should load the PHP module.

2. .php extension should be associated with MIME-type application/x-httpd-php

Good luck!
Smarter Toys make Smarter Kids!
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:




Views: 2115 | Replies: 1
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC