hi !

I have been getting the Error : "Fatal error: Call to undefined function: mysql_connect()" for the script line containing the mysql_connect() function.

I just did a fresh installation of Red Hat Linux - 9(Server). PHP seems to have got installed automatically during the Linux O.S installation. I had to install mysql manually after i got Linux up and running. Mysql seems to be working absolutely fine. I can get to the mysql prompt and run all possible mysql commands..they work fine. I did knock off the php package and re-installed it again. But it just wont work !

The PHP version is 4.2.2 , Mysql version is 3.23.

I ran the phpinfo() function. It did not display any details about Mysql. The "Configure Command" section of phpinfo() indicated '--with-mysql=shared,/usr' too.

I am lost ! Can somebody help me out ?

    The only thing that occurs to me is that php is looking for mysql in the wrong place. I believe the default is /usr/local/ and php is looking in /usr. to fix this it would require a recompile (or you might just want to up grade to 4.3.x since they are in production...) Hopefully this helps, or even better someone else can post with an easier solution!

      hi !

      I managed to find a way out. I had not installed the php-mysql package. I used the rpm : php-mysql-4.2.2-17.i386.rpm. This package contains a dynamic shared object that adds MySQL database support to PHP.

      thanx !

        Write a Reply...