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

I get this error quite often:

PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_mysql.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20170718/pdo_mysql.so (/usr/local/lib/php/extensions/no-debug-non-zts-20170718/pdo_mysql.so: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20170718/pdo_mysql.so.so (/usr/local/lib/php/extensions/no-debug-non-zts-20170718/pdo_mysql.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

Any ideas how to resolve it?