Swim89
Swim89

Reputation: 310

Laradock error on mysql_connect

I have a problem with mysqli and mysql. I'm using laradock on Mac, after the docker-compose up -d nginx mysql phpmyadmin and try to open my PHP project on web, I have this error:

Fatal error: Uncaught Error: Call to undefined function `mysqli_connect()` in /var/www/f......

I read the php specs with phpinfo() but Mysql seems to be set correctly.

Can anyone help me to solve it?

Upvotes: 1

Views: 944

Answers (2)

Swim89
Swim89

Reputation: 310

I solve myself. On .env file of Laradock I enabled MYSQL

PHP_FPM_INSTALL_MYSQLI=true

After in terminal I launched this command

docker-compose build php-fpm

Upvotes: 2

sanath meti
sanath meti

Reputation: 6603

Install php5-mysql

 apt-get install php5-mysql 

And also make sure that you removed ; in php.ini file for below extension. This file can be found in etc/php5/apache2/php.ini

extension=php_mysqli.dll

Upvotes: 0

Related Questions