Fatal error: Call to undefined function mysql_connect
Jeffrey F. Bloss
jbloss at tampabay.rr.com
Thu Feb 15 13:00:56 UTC 2007
Patrick Newberry wrote:
> <snip_from_previous_email>
> ...but that too should have been installed as a dependency. It might
> not hurt to double check though.
> </snip_from_previous_email>
>
> By double checking do you mean going into synaptic and looking at that
> list, or is there some other way to check for dependencies for a
> package.
Synaptic should do for this. Just check to be sure you have both
php5-mysql and php5-mysqli installed. I suspect they are, but it
doesn't hurt to check.
> <snip_from_previous_email>
> There's also some entries in /etc/mime.types and
> /etc/apache2/mods-enabled/php5.conf. ;)
> </snip_from_previous_email>
>
> /etc/mime.types as follows:
>
> application/x-httpd-php phtml pht php
> application/x-httpd-php-source phps
> application/x-httpd-php3 php3
> application/x-httpd-php3-preprocessed php3p
> application/x-httpd-php4 php4
>
> Should there be a php5 entry?
No, that looks fine.
>
> There is no /etc/apache2/mods-enabled/php5.conf file
There should be. Apparently your un/re-installing disabled PHP somehow.
Try this in a terminal (and then restart Apache)...
sudo a2enmod php5
You should have both a php5.conf and php5.load
in /etc/apache2/mods-enabled. Mine are short and look like this...
php5.conf
<IfModule mod_php5.c>
AddType application/x-httpd-php .php .phtml .php3
AddType application/x-httpd-php-source .phps
</IfModule>
php5.load
LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
> there is a /etc/apache2/apache2.conf
> which has the line:
> AddType application/x-httpd-php .php
Did you un-comment this line? You said you commented it out. It needs
to be there.
> goshawk at gypsyfarm:~$ hostname
> gypsyfarm
> goshawk at gypsyfarm:~$ hostname -f
> localhost
>
> ok one has gypsyfarm, one had localhost.
That's a problem. It's causing your Apache start up errors and it could
prevent MySQL from working properly. It's *preferable* to have a FQDN
but not absolutely necessary. The key is to have everything in sync.
You need to edit both your /etc/hosts and /etc/hostname so that all the
names are the same, even if they're just "gypsyfarm" or "localhost".
Then all your MySQL settings have to point to that host name.
These are short text files also, so here's mine for example...
/etc/hosts
127.0.0.1 localhost.localdomain localhost
192.168.1.10 wrench.homelinux.net wrench
# The following lines are desirable for IPv6 capable hosts
[... clipped...]
/etc/hostname
wrench.homelinux.net
Yours will be different of course, the key is to get the appropriate
entries in both files the same. I believe you could just as easily
remove the 192.xxx from hosts and set hostname to
'localhost.localdomain' for example. But having "localhost" in one
place and "gypsyfarm" in another only leads to confusion.
--
_?_ Outside of a dog, a book is a man's best friend.
(o o) Inside of a dog, it's too dark to read.
-oOO-(_)--OOo------------------------------[ Groucho Marx ]---
http://wrench.homelinux.net/~jeff/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 892 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20070215/e8e134ea/attachment.sig>
More information about the ubuntu-users
mailing list