0

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.

3
  • 2
    ^ The opposite actually. Seems like you have an outdated extension line in your php.ini Commented Jul 6, 2018 at 1:55
  • 1
    What's your php version? Commented Jul 6, 2018 at 2:03
  • 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. Commented Jul 9, 2018 at 11:49

1 Answer 1

1

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!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.