6

I already refered the link, PHP5 similar issue

and tried all relevant solutions but I'm still getting following issues. Any help is appreciated. Thanks !

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/msql.so' - /usr/lib/php/20131226/msql.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/php/20131226/php_pdo_mysql.dll' - /usr/lib/php/20131226/php_pdo_mysql.dll: cannot open shared object file: No such file or directory in Unknown on line 0 PHP 5.6.38-3+ubuntu14.04.1+deb.sury.org+1 (cli) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

7
  • Have you installed php-pdo_mysql? Commented Feb 16, 2019 at 13:04
  • I have executed two commands, apt-get install php5.6-mysql & sudo phpenmod pdo_mysql then restarted. Still same issue Commented Feb 16, 2019 at 13:15
  • You can confirm it by using phpinfo() or php -i | grep pdo from your terminal Commented Feb 16, 2019 at 13:39
  • It has /20-pdo_mysql.ini file. so it is installed right? Commented Feb 16, 2019 at 13:43
  • I guess so. When you say you restarted, what did you restart exactly ? Depending on your server config you might need to restart apache2/nginx and php-fpm Commented Feb 16, 2019 at 13:45

1 Answer 1

2

your php .ini configuration file(s) makes references to several files that does not exist, for instance /usr/lib/php/20131226/php_pdo_mysql.dll, your php installation has been corrupted. it's probably easier to just re-install PHP, but if you want to repair it manually, make a page called phpinfo.php and have it contain

<?php phpinfo(~0);

and open it in a browser, you will get the location of php.ini and a list of additional ini configuration files parsed, and once you have that, scan the php.ini file, and all additional configuration files, and remove all references to the files that does not exist. for example in this screenshot:

enter image description here

here you'd have to scan the files /etc/php/7.0/fpm/php.ini and /etc/php/7.0/fpm/conf.d/10-mysqlnd.ini and /etc/php/7.0/fpm/conf.d/10-opcache.ini and /etc/php/7.0/fpm/conf.d/10-pdo.ini and /etc/php/7.0/fpm/conf.d/15-xml.ini and /etc/php/7.0/fpm/conf.d/20-calendar.ini and /etc/php/7.0/fpm/conf.d/20-ctype.ini and /etc/php/7.0/fpm/conf.d/20-curl.ini and /etc/php/7.0/fpm/conf.d/20-dom.ini and /etc/php/7.0/fpm/conf.d/20-exif.ini and /etc/php/7.0/fpm/conf.d/20-fileinfo.ini and /etc/php/7.0/fpm/conf.d/20-ftp.ini and /etc/php/7.0/fpm/conf.d/20-gd.ini and /etc/php/7.0/fpm/conf.d/20-gettext.ini and /etc/php/7.0/fpm/conf.d/20-iconv.ini and /etc/php/7.0/fpm/conf.d/20-json.ini and /etc/php/7.0/fpm/conf.d/20-mbstring.ini and /etc/php/7.0/fpm/conf.d/20-mysqli.ini and /etc/php/7.0/fpm/conf.d/20-pdo_mysql.ini and /etc/php/7.0/fpm/conf.d/20-pdo_sqlite.ini and /etc/php/7.0/fpm/conf.d/20-phar.ini and /etc/php/7.0/fpm/conf.d/20-posix.ini and /etc/php/7.0/fpm/conf.d/20-readline.ini and /etc/php/7.0/fpm/conf.d/20-shmop.ini and /etc/php/7.0/fpm/conf.d/20-simplexml.ini and /etc/php/7.0/fpm/conf.d/20-sockets.ini and /etc/php/7.0/fpm/conf.d/20-sqlite3.ini and /etc/php/7.0/fpm/conf.d/20-ssh2.ini and /etc/php/7.0/fpm/conf.d/20-sysvmsg.ini and /etc/php/7.0/fpm/conf.d/20-sysvsem.ini and /etc/php/7.0/fpm/conf.d/20-sysvshm.ini and /etc/php/7.0/fpm/conf.d/20-tokenizer.ini and /etc/php/7.0/fpm/conf.d/20-wddx.ini and /etc/php/7.0/fpm/conf.d/20-xdebug.ini and /etc/php/7.0/fpm/conf.d/20-xmlreader.ini and /etc/php/7.0/fpm/conf.d/20-xmlwriter.ini and /etc/php/7.0/fpm/conf.d/20-xsl.ini for references to the files that does not exist, and remove those references... have fun

(but seriously, you'd probably be better off just re-installing the requred version of PHP. by your comments, i see you already have multiple versions of PHP installed.)

Sign up to request clarification or add additional context in comments.

4 Comments

I got some missing libraries in the past but that didn’t prevent my app from working ?
phpinfo(~0); vs phpinfo(); ?
@113408 well some libs you can live without, but many php codebases would stop working when php_pdo_mysql.dll cannot be loaded, it would probably make new PDO() stop working, at least if you're trying to connect to a MySQL or MariaDB database
@abdulrashid probably very little, the argument for phpinfo() is a bunch of bit-flags to decide what info to show, and ~0 enables every possible flag. (on x86-cpus, doing -1 also enables every possible flag, but idk if that's portable to other cpus), but it's probably not needed since the default argument (now at least?) is INFO_ALL which is also supposed to print all possible info

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.