简体   繁体   中英

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/mysql.so'

I recently installed EHCP with all the necessary packages and now everytime I try to run my laravel project by typing php artisan serve , I get the following error:

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/mysql.so' - /usr/lib/php/20151012/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0

Please help, thank you.

Do you have the mysql extension installed? If not, you may need to install it.

apt-get install php-mysql

In ubuntu 16.04 and above (as I can remember), this will install the module for PHP7 by default. So you need to check your php version and install the relevant one.

Ex: apt-get install php5.6-mysql

Then check you have the module installed by running:

php -m | grep mysql

Hope it helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM