• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

PHP 5.1.2, Horde & DB_mysql as array fatal error

M

methyl_blue

Guest
I was getting the following error:

Code:
PHP Fatal error:  Cannot use object of type DB_mysql as array in /usr/share/psa-horde/lib/Horde/DataTree.php on line 657

after upgrading to the latest version of Horde and I thought I'd share how I fixed it in case it helps someone out.

The problem is that Plesk uses a custom version of Horde with an out of date version of the Pear DB package that isn't compatible with PHP 5.1.2.

The work around is to upgrade DB manually and then add it to the Plesk/Horde installation.

To do so, issue the following command via SSH as root (without the #, naturally):

Code:
# pear upgrade DB

Then copy or symlink the following file and directory:

Code:
/usr/share/pear/DB.php
/usr/share/pear/DB

to

Code:
/usr/share/psa-horde/pear/DB.php
/usr/share/psa-horde/pear/DB

and you should be right as rain.

It's probably worth backing up the old version of DB installed with Plesk's version of Horde though - just in case.
 
Thank you and NOTICE

Thank you for this solution. This is a HUGE problem with the psa-horde package currently in Plesk 8. If they are going to ship their own libraries for things, they should ensure that they are current. This problem has a couple records on this forum.

I also have one other thing to mention. If you are running a machine with PHP4 also installed and left it alone, building your own customer PHP5 inside /usr/local/bin/php, you might have to copy the PEAR sources from /usr/local/lib/php instead of /usr/share/pear.

I had to do a couple rounds of "process of elimination" to make sure I was copying from the right place. So if this doesn't appear to be working for you, MAKE SURE.
 
Hey great post, is this using my php 5.1 rpms or something you rolled on your own? I could probably add in a trigger to that package to detect psa-horde and automate adding in your fix
 
In my particular case it is RHEL3. I left the PHP4 RPMs in place and built PHP 5.1.2 from source.

PHP4 remains in his locations where PHP5 is now in /usr/local/bin and /usr/local/lib/php so that they are picked up along the paths first as an OS customization rather than trying to replace what is installed and received through the vendor maintenance stream.

Running PHP commands for version and pathing information should be sufficient to detect this situation.
 
Originally posted by atomicturtle
is this using my php 5.1 rpms or something you rolled on your own?

I compiled PHP from source as I wanted to specify a few extra features to be included. At the time I didn't know about your RPMs though - they look excellent. I'm eyeing up the MySQL ones as I type. Upgrading databases is usually such a pain.

Originally posted by cuppett
Thank you for this solution.
Originally posted by atomicturtle
Hey great post

Happy to be of service :)
 
Back
Top