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

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! :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.