0
votes

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.

1
^ The opposite actually. Seems like you have an outdated extension line in your php.ini - Devon
What's your php version? - Nimeshka Srimal
As pointed out by @Devon, it's an outdated extension line: the API number in the path is for 7.0.X, for which there is no mysql extension as it was removed. - Joe Watkins

1 Answers

1
votes

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!