[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: PHP: mysql_connect() undefined function



2006/8/16, Stephen <stephen.d.allen@gmail.com>:
On Wed, Aug 16, 2006 at 05:52:46PM +0200 or thereabouts, Paolo Pantaleo wrote:
> 2006/8/16, Stephen <stephen.d.allen@gmail.com>:
> >On Wed, Aug 16, 2006 at 05:24:44PM +0200 or thereabouts, Paolo Pantaleo

> >> Any suggestion?
> >
> >I suspect that php4-mysql isn't installed and/or activated.
> >
> >Therefore try 'aptitude install php4-mysql' or 'apt-get install
> >php4-mysql'.
>
> Well I installed php5 (and php5-mysql), should I use php4 (I have testing) ?

No.

I find it very strange that PHPMyAdmin will connect to the same host though.
This error you've received is indicative of PHP not able to connect to the
MySQL socket, so it's very strange that it works with PHPMyAdmin connecting
to the same host. Is the database on the same server as Apache ?

Sorry, I'm out of ideas.

--
Regards
Stephen


I think the error says that PHP doesn't know the function, not that
there is an error executing the function.

So, finally googling around I found the solution:

in /etc/php/apache2/php.in

I uncommented the line

extension=mysql.so

This is because [so I read] the mysql support is bult-in for version
4, but not for version 5.

[I think another solution is to use php4, then]

I hope this it could help Kevin too.

Thnx everybody for the help
PAolo



Reply to: