Hi,

I want to use PHP that is pre-installed in Redhat Linux 8.0 to connect MySQL 3.23. However, it shows an error and have no response repectively.


Situation 1:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
</head>
<body>
<?php
$db = mysql_pconnect()
or die("Error: Could not connect to the database.");
echo "Finish testing connection.";
?>
</body>
</html>

I got the following result from the returned PHP page:

Fatal error: Call to undefined function: mysql_pconnect() in /var/www/html/public_html/temp/insertAction.php on line 8


Situation 2:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
</head>
<body>
<?php
@ $db = mysql_pconnect();
if (!$db) {
echo "Error: Could not connect to the database.";
exit;
} else
echo "Connect to the database successfully";
echo "Finish testing connection.";
?>
</body>
</html>

I got the following result from the returned PHP page:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
</head>
<body>


I have tried to install "php-4.2.2-8.0.5.src.rpm" which is downloaded from (http://www.redhat.com/swr/i386/php-mysql-4.2.2-8.0.5.i386.html). However, I have tried to install it and got the following error message:
Shell > rpm -i php-4.2.2-8.0.5.src.rpm
warning: php-4.2.2-8.0.5.src.rpm: V3 DSA signature: NOKEY, key ID db42a60e

Could anyone suggest me to solve the problem? Welcome to Email me at: carrotmail1220@yahoo.com.hk.

Regards,

Bruce

    2 months later

    I'm having the same problem - and I installed everything myself... It almost seems as if there are built-in functions that aren't available. It seems that most other functionality of PHP is working on my machine.... how about yours??

    If I find anything - I'll be sure to reply and update...

    Good Luck!

      When installing PHP and MySQL from the installation CDs for RedHat you need to install the PHP-MySQL rpm as well. This is the set of compiled client libraries that allow php to connect to mysql.

      If you can't find it on your installation CDs go to the RedHat download center and the latest version is there.

      link - http://www.redhat.com/swr/i386/php-mysql-4.2.2-8.0.5.i386_dl.html

      Hope this helps 😉

        19 days later

        Hi,

        After I downloaded php-mysql-4.2.2-8.0.5.i386.rpm and type "rpm -i php-mysql-4.2.2-8.0.5.i386.rpm", I found the following error, can anyone help me? Many Thx!!!!

        Error:

        warning: php-4.2.2-8.0.5.src.rpm: V3 DSA signature: NOKEY, key ID db42a60e

          a year later

          I also had problems:

          [root@linux root]# rpm -i php-mysql-4.3.3-6.i386.rpm
          warning: php-mysql-4.3.3-6.i386.rpm: V3 DSA signature: NOKEY, key ID 4f2a6fd2
          error: Failed dependencies:
                  libmysqlclient.so.10 is needed by php-mysql-4.3.3-6
          

          Ideas?

            Hi, I found out that libmysqlclient.so10 came with earlier builds of MySQL than mine (I am running 4.0.18-standard). The library above comes with version 3.x (not sure how late).

            In order to get the .so10 lib you have to install
            MySQL-shared-3.23.37-3.i386.rpm. I did that and then was able to install php-mysql-4.3.3-6.i386.rpm.

            It installed without a problem then, but I still get the same error about a call to undefined function: mysql_connect(). Other ideas?

            😕

            Thanks!

              Write a Reply...