[Techtalk] Fatal error: Call to undefined function: mysql_connect()

Leonidas O Brandao leo at ime.usp.br
Wed Sep 17 22:35:46 EST 2003


Hi Mike,

Mike Clark wrote:

 Hi LinuxChix

 On this machine PHP is unable to connect to MySQL.

 Debian linux kernel 2.2.19
 PHP version 4.0.3pl1,
 MySQL distribution 3.22.32 on port 3306.

 ...

 Does anybody have any ideas?

 Thanks

 Mike Clark

Well, I just fixed the same problem in my machine (Debian 2.4, PHP 4.1.2-6
and 3.23.49-8 in the same 3306 port), after I read your question.

I followed the same path as you. After I read your msg I realized that the
problem could be that the module MySQL isn't in PHP. So I examined the
loaded modules of PHP with "php4 -m": the answer was

|Running PHP 4.1.2
|Zend Engine v1.1.1, Copyright (c) 1998-2001 Zend Technologies
|
|[PHP Modules]
|yp
|xml
|wddx
|sysvshm
|sysvsem
|standard
|sockets
|shmop
|session
|posix
|pcre
|mbstring
|iconv
|gettext
|ftp
|filepro
|exif
|dba
|ctype
|calendar
|bz2
|bcmath
|zlib
|
|[Zend Modules]
|Not Implemented

Well, the "mysql" wan't there! Then I search a bit more and found a
lack: the package "php4-mysql" of Debian!

With "php4-mysql", the team became complete: 

|[...]> php4 -m
|
|Running PHP 4.1.2
|Zend Engine v1.1.1, Copyright (c) 1998-2001 Zend Technologies
...
|zlib
|mysql
..

Final result: Apache + PHP + MySQL recognizes correctly the MySQL
commands!

Good luck to you!

Leônidas

 --------------------------------------------------------------------------
 Leônidas de Oliveira Brandão  -  Computer Science Dep. of IME-USP (Brazil)
 leo at ime.usp.br - http://www.ime.usp.br/~leo - +55 (011) 3091 [6298 | 6135] 
 Interessado em Matemática?  Visite o "iMatica":   http://www.matematica.br



More information about the Techtalk mailing list