You are not logged in.

#1 2011-03-25 16:55:24

jayray
Member
Registered: 2006-10-15
Posts: 38

PHP issues after Mysql upgrade to 5.5.10-2 from 5.5.9-1

Noticed that all php scripts stopped working after Mysql upgraded and servers were rebooted. everything is up to date. I rolled back the following and it started working again.

mysql
mysql-clients
libmysqlclient

Mysql seemed to be running ok otherwise.. I tested perl dbi connections with no issues, and connected with mysql admin tools across the network with no issues. All problems point to PHP connecting to Mysql. I tried running php test scripts from cli to test DB connectivity, but they would not connect.  Any advise is greatly appreciated.
Thanks,
J

Offline

#2 2011-03-25 17:04:25

Pierre
Developer
From: Bonn
Registered: 2004-07-05
Posts: 1,964
Website

Re: PHP issues after Mysql upgrade to 5.5.10-2 from 5.5.9-1

The new mysql works fine here. In fact PHP does not even use the mysql lib to connect to the mysql server. It would be helpful if you could post the complete error message.

Offline

#3 2011-03-25 17:39:55

jayray
Member
Registered: 2006-10-15
Posts: 38

Re: PHP issues after Mysql upgrade to 5.5.10-2 from 5.5.9-1

Apologies, I have been trying to get a more intuitive error message, but this is all I have so far:

Fatal error: Call to undefined function mysql_connect() in /public/www/cacti/test.php on line 6

Below is test.php code

<?php
    $dbhost = "localhost";
    $dbuser = "root";
    $dbpass = "XXXX";

    $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die (`Error connecting to mysql`);

    if ($conn) {
    echo "CONNECT OK";
    }

    $dbname = "mysql";
    mysql_select_db($dbname);
    ?>

Offline

#4 2011-03-25 17:53:32

Pierre
Developer
From: Bonn
Registered: 2004-07-05
Posts: 1,964
Website

Re: PHP issues after Mysql upgrade to 5.5.10-2 from 5.5.9-1

Well, just make sure to have the mysql.so module enabled in your php.ini.

Offline

#5 2011-03-25 17:59:24

jayray
Member
Registered: 2006-10-15
Posts: 38

Re: PHP issues after Mysql upgrade to 5.5.10-2 from 5.5.9-1

It is enabled. It has been working fine up until the mysql upgrade. As soon as I downgrade it works again.

Offline

#6 2011-03-25 18:03:56

Pierre
Developer
From: Bonn
Registered: 2004-07-05
Posts: 1,964
Website

Re: PHP issues after Mysql upgrade to 5.5.10-2 from 5.5.9-1

I somehow doubt that. That error is not related to mysql itself. PHP simply does not know about this function which indicates that the mysql module is not loaded. Check the output of php -m and create a file containing "<?php phpinfo(); ?>" and check that output as well. (means look if the mysql module is listed) This will even work if mysql is not started or even not installed at all.

Offline

#7 2011-03-25 19:21:50

Søkka
Member
From: Apeldoorn, Netherlands
Registered: 2011-02-10
Posts: 5
Website

Re: PHP issues after Mysql upgrade to 5.5.10-2 from 5.5.9-1

I'm having MySQL errors as well with my Rails apps after upgrading :

  Status: 500 Internal Server Error
  uninitialized constant MysqlCompat::MysqlRes

Haven't changed anything either, just did a 'pacman -Syu' and it broke =\

Offline

#8 2011-03-26 00:03:10

jayray
Member
Registered: 2006-10-15
Posts: 38

Re: PHP issues after Mysql upgrade to 5.5.10-2 from 5.5.9-1

Still researching the issue. Seems to be isolated to libmysqlclient-5.5.10-2. Downgraded only that package and everything is still working.

Offline

#9 2011-03-26 01:19:22

ilpianista
Fellow developer
Registered: 2007-10-06
Posts: 568
Website

Re: PHP issues after Mysql upgrade to 5.5.10-2 from 5.5.9-1

Søkka wrote:

I'm having MySQL errors as well with my Rails apps after upgrading :

  Status: 500 Internal Server Error
  uninitialized constant MysqlCompat::MysqlRes

Haven't changed anything either, just did a 'pacman -Syu' and it broke =\

You've to rebuild it. See https://bbs.archlinux.org/viewtopic.php … 98#p904498

Offline

#10 2011-03-26 14:52:27

jayray
Member
Registered: 2006-10-15
Posts: 38

Re: PHP issues after Mysql upgrade to 5.5.10-2 from 5.5.9-1

So would it be safe to say that my PHP issues are caused by the same problem?

Offline

#11 2011-03-26 18:05:12

vae77
Member
Registered: 2010-07-02
Posts: 75
Website

Re: PHP issues after Mysql upgrade to 5.5.10-2 from 5.5.9-1

Problems with python too, I've just did on my virtualenvs:
pip uninstall MySQL-python  and pip install MySQL-python

Thanks bash for the tip.

Offline

#12 2011-03-26 18:10:17

ilpianista
Fellow developer
Registered: 2007-10-06
Posts: 568
Website

Re: PHP issues after Mysql upgrade to 5.5.10-2 from 5.5.9-1

jayray wrote:

So would it be safe to say that my PHP issues are caused by the same problem?

No. As Pierre said, php from [extra] doesn't need to be rebuilt and php52 (5.2.17-5) from [community] has been rebuilt.

Offline

#13 2011-03-26 19:47:08

jayray
Member
Registered: 2006-10-15
Posts: 38

Re: PHP issues after Mysql upgrade to 5.5.10-2 from 5.5.9-1

Uninstalled php and deps, reinstalled/upgraded and all is working.... Can't explain it.
Thanks,
J

Offline

Board footer

Powered by FluxBB