Local Apache server will sot serve PHP files

Jochem Kossen jkossen at xs4all.nl
Sun Jan 1 18:17:52 UTC 2006


On Mon, Jan 02, 2006 at 02:36:38AM +0900, Dave M G wrote:
> Thank you for the advice. I have two follow up questions.
> 
> 	1. By installing libapache2-mod-php4, it seems PHP is now being
> interpreted by Apache. So as a next step, I copied one of my web sites
> from my web hosting service to my local machine.
> 	When I attempted to run index.php of my web site, I got the error
> "Fatal error: Call to undefined function: mysql_pconnect()".
> 	I checked Synaptic again, and I have the php4-mysql module installed.
> 	Is this an indicator of a missing component or configuration problem?

Somehow the mysql extension does not seem to be enabled, check to see if
the following line is in /etc/php4/apache2/php.ini:

extension=mysql.so

And make sure it's uncommented

> 	2. I thought that there was a configuration for Apache which would make
> it so that PHP script would be parsed within an HTML file. Is that not
> possible?

It is possible, in /etc/apache2/mods-available/php4.conf there's a line
like this:

AddType application/x-httpd-php .php .phtml .php3

Just add .html at the end of it, and restart apache.

-- 
Jochem Kossen - http://jkossen.nl 




More information about the ubuntu-users mailing list