4

on an ubuntu 12.04 i have upgraded to PHP 5.4 according to this tutorial http://www.upubuntu.com/2012/03/how-to-upgrade-install-php-540-under.html But when i call php5 -v i get

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/mysql.so' - /usr/lib/php5/20100525/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/mysqli.so' - /usr/lib/php5/20100525/mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/pdo_mysql.so' - /usr/lib/php5/20100525/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 5.4.0-3~lucid+4 (cli) (built: Mar 27 2012 08:55:12) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

how can i fix it without breaking more stuff? ;)

edit, when trying to install php5-mysql

sudo apt-get install php5-mysql

i get

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php5-mysql : Depends: libmysqlclient16 (>= 5.1.21-1) but it is not installable
E: Unable to correct problems, you have held broken packages.
2
  • 1
    with the new installation the folder .so folder changes, yo need to reinstall these packages or re-build it.
    – ZiTAL
    Apr 23, 2012 at 15:25
  • maybe there is no package from mysqli in the repositories for now, try using dotdeb.org/mirrors repos
    – ZiTAL
    Apr 23, 2012 at 16:36

5 Answers 5

3

Installing newer PHP versions on Ubuntu machines that doesn't support them is not recommended.

If you really need, you should try installing the PHP and MySQL packages from DotDeb, which has all of the extensions built as well. Instructions on their website http://www.dotdeb.org/instructions/

If installation asks for newer versions of your libs, you can download them from http://packages.debian.org and install them manually using dpkg -i packagename.deb.

Note that this can ruin your Ubuntu installation. Test this on a Virtual Machine or recoverable environment, never in production.

1
  • +1 For the hint on dotdeb.
    – hakre
    Apr 25, 2012 at 8:43
2

Have you tried to restart your webserver?

sudo /etc/init.d/apache2 restart

Haven't used Ubuntu in a while but I believe that's it

and then after that try re installing the packages in question. The MySQL ones

3
  • yes, same error....and i cannot find those missing so files on my system, when running updatedb and locate mysqli.so
    – Confidence
    Apr 23, 2012 at 15:31
  • 1
    php5 -v is from console not from apache
    – ZiTAL
    Apr 23, 2012 at 16:37
  • i fixed it simply buy undoing the whole process and returning back to 5.3
    – Confidence
    Apr 23, 2012 at 17:17
1

Ubuntu 12.4 is still beta phase ( final beta ) as far as i know. Since libmysqlclient16 has been removed from Ubuntu 12.04 repos you will need to install it manually. Download packages: 32 bit version - http://launchpadlibrarian.net/94563300/libmysqlclient16_5.1.58-1ubuntu5_i386.deb 64 bit version - http://launchpadlibrarian.net/94808408/libmysqlclient16_5.1.58-1ubuntu5_amd64.deb

and then install it with: sudo dpkg -i libmysqlclient16_5.1.58-1ubuntu5_XXX.deb Probably you will need to upgrade your mysql server to 5.1.58

0
1

I have this problem as well on Debian Testing/Wheezy. I have no idea why the extensions are being installed to /usr/lib/php5/20100525/, but it seems that's where they are. To fix it, open up your php.ini file wherever that may be (probably in /etc/php* or something) and modify/add the following line:

extension_dir = "/usr/lib/php5/20100525/"

Then restart your php5-fpm if you know how, or just reboot the machine and PHP should be working again.

0

This package is obsolete for Debian version 7. Then one option is to disable it.

  1. go to /etc/php5/conf.d/
  2. edit /etc/php5/conf.d/mhash.ini
  3. disble adding ; next line like that

    ;extension=mhash.so
    

This library is found in /usr/lib/pyshared/python2.7. I tried to link (ln) to this but is not worked because show a binary error.

You must log in to answer this question.