PHP 7.0 and MySQL start-up error “undefined symbol: mysqlnd_allocator in Unknown”

前端 未结 3 621
日久生厌
日久生厌 2021-01-14 11:11

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

Tried all solutions posted. What could cause this?

相关标签:
3条回答
  • 2021-01-14 11:57

    (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.

    0 讨论(0)
  • 2021-01-14 12:00

    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:

    extension=mysqlnd    
    extension=pdo
    extension=pdo_mysql
    

    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

    0 讨论(0)
  • 2021-01-14 12:05

    I found that I had

    extension=pdo_mysql
    

    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.

    0 讨论(0)
提交回复
热议问题