• Uncategorized

About php : PHP-70-and-MySQL-start-up-error-undefined-symbol-mysqlndallocator-in-Unknown

Question Detail

Getting this warning on a custom-compiled version of PHP7, even when running php -v.

Tried all solutions posted. What could cause this?

PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20151012/pdo_mysql.so’ – /usr/lib/php/20151012/pdo_mysql.so: undefined symbol: mysqlnd_allocator in Unknown on line 0

There are similar questions to this, but they are not quite the same problem – they generally relate to a missing mcrypt library. I confirmed that mycrypt is in fact loaded, as well as pdo_mysql when printing out phpinfo().

Is there something wrong with the order? Also, this is for PHP 7, which I believe has different formats for ini files.

Edit: Following instructions here for recompile. Not too experienced in this: http://www.hashbangcode.com/blog/compiling-and-installing-php7-ubuntu

Also, removed MySQL completely with apt-get purge. No luck with anything.

Question Answer

I found that I had


uncommented in my php.ini file and this was causing the problem. Libraries are loaded by the files in the /etc/php/7.4/cli/conf.d/ file on my system and don’t need to be loaded by uncommenting lines in the php.ini file.

(Posted on behalf of the OP).

Commands performed in order; I removed MySQL and PHP completely from system then:

sudo apt-get update
sudo apt-get install php7.0
sudo apt-get install php7.0-mysql

This seems to have fixed the error. Uuuugh.

Sometimes there is an issue with not loaded correctly extensions in the php.ini file.
I had similar error and it start working only after I have added these extensions before pdo_mysql to the php.ini:


And it finally worked!

However it shows warnings that mysqlnd, PDO and pdo_mysql was loaded before, it means that pdo_mysql already enabled and can be commented out at all. For further info please check PHP Warning: Module already loaded in Unknown on line 0

You may also like...

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.