Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.6K
Views
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_mysql.so'

I ran the command:

php -v

Output:

PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_mysql.so' (tried: /usr/lib/php/20170718/pdo_mysql.so (/usr/lib/php/20170718/pdo_mysql.so: undefined symbol: mysqlnd_allocator), /usr/lib/php/20170718/pdo_mysql.so.so (/usr/lib/php/20170718/pdo_mysql.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

I ran this command:

php -m

Output:

PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_mysql.so' (tried: /usr/lib/php/20170718/pdo_mysql.so (/usr/lib/php/20170718/pdo_mysql.so: undefined symbol: mysqlnd_allocator), /usr/lib/php/20170718/pdo_mysql.so.so (/usr/lib/php/20170718/pdo_mysql.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
    [PHP Modules]
    bz2
    calendar
    Core
    ctype
    curl
    date
    dom
    exif
    fileinfo
    filter
    ftp
    gd
    gettext
    hash
    iconv
    intl
    json
    libxml
    mbstring
    openssl
    pcntl
    pcre
    PDO
    Phar
    posix
    readline
    Reflection
    session
    shmop
    SimpleXML
    soap
    sockets
    sodium
    SPL
    standard
    sysvmsg
    sysvsem
    sysvshm
    tokenizer
    wddx
    xml
    xmlreader
    xmlwriter
    xsl
    Zend OPcache
    zip
    zlib

    [Zend Modules]
    Zend OPcache

The php.ini file contains this line:

extension=pdo_mysql

Ran this command:

sudo apt-get install -y php-pdo-mysql

Nothing is installed, because it is already installed.

Ran this command:

php -i

Output shows:

PDO

PDO support => enabled
PDO drivers =>

Not sure why this is or what to do. Any suggestions?

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

You are probably using php7.2, so you should edit the php.ini file (/etc/php/7.2/cli/php.ini).

And probably extension=pdo_mysql on line 906 is uncommented. Comment this line by adding ; at the beginning of the line.

After saving and closing php.ini the error should disappear, however, to ensure that the changes take effect, restart the php service:

$ sudo systemctl restart php7.2-fpm

over 4 years ago · Santiago Trujillo Report

0

I solved the problem this way:

sudo apt-get --purge remove php-common

sudo apt-get install php-common php-mysql php-cli

Now there is no error and php -m shows it has everything:

over 4 years ago · Santiago Trujillo Report

0

Make sure that the location of pdo_mysql.so file is the same of the PHP extension_dir:

# php -i|grep extension_dir
# find / -name pdo_mysql.so

By doing this, and adding the absolute path on the php.ini like this:

extension=/usr/lib/php/20190902/pdo_mysql

this will work.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!