cancel
Showing results for 
Search instead for 
Did you mean: 

Error message "pdo_mysql extension is not installed" during deploy static files

SOLVED

Error message "pdo_mysql extension is not installed" during deploy static files

Hello,

 

When I try to execute "php bin/magento setup:static-content:deploy" in order to generate css files from less files, I have the error message "pdo_mysql extension is not installed". I have check the phpinfo() and the extension pdo_mysql is enabled :

pdo_mysql
PDO Driver for MySQL enabled
Client API version mysqlnd 5.0.12-dev - 20150407 - $Id: 38fea24f2847fa7519001be390c98ae0acafe387 $

I'am under Magento 2.2.6 / Windows 10 / Wampserver 3.0.6 / PHP 7.1.27 / Mysql 5.7.14.

Is anyone have an idea please ?

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Error message "pdo_mysql extension is not installed" during deploy static files

Hello Nisha,

 

Thanks for your reply, the problem was with Wamp Server there are 2 files php.ini (php.ini and phpForApache.ini) and php.ini was empty. I have resolved the problem by copy phpForApache.ini in php.ini.

 

Thanks again for your help. 

View solution in original post

6 REPLIES 6

Re: Error message "pdo_mysql extension is not installed" during deploy static files

Hi

I am going to assume that you have PHP 7

  1. If it isn't already, install php7.0-mysql:

    sudo apt-get install php7.0-mysql
  2. It is possible that it was already installed but the pdo_mysql module wasn't enabled. Either way, enable pdo_mysql:

    sudo phpenmod pdo_mysql
  3. Then just restart Apache:

    sudo service apache2 restart

    Hope it helps!

    if issue solved,Click Kudos & Accept as Solution

Re: Error message "pdo_mysql extension is not installed" during deploy static files

Thanks for your reply arifcs but I'am working in local on Windows and Wamp Server.
The phpinfo() command display that the pdo_mysql is enabled :

 

PDO Driver for MySQL enabled Client API version mysqlnd 5.0.12-dev - 20150407 - $Id: 38fea24f2847fa7519001be390c98ae0acafe387 $

 

Have yo another idea to resolve or onvestigate this problem ?

Re: Error message "pdo_mysql extension is not installed" during deploy static files

@YohannentoDo you have multiple version of PHP on WAMP? Do you see the issue only during static file deployment or for all the commands you run from command line?

 

Possibly from the command line you are using different version of PHP which does not have mysql pdo enabled.

 

Problem solved? Please give 'Kudos' and accept 'Answer as Solution'.

- Tarandeep
Problem solved?Please give 'Kudos' and accept 'Answer as Solution'.

Re: Error message "pdo_mysql extension is not installed" during deploy static files

Hello @Yohannento 

 

If pdo_mysql extension is already installed on your local system and still facing this issue. You can use the below command to deploy static files using dmemory limit.

 

sudo /opt/lampp/bin/php -dmemory_limit=6G bin/magento setup:static-content:deploy 

Hope it will work for you.

 

If my answer is useful, please Accept as Solution & give Kudos.

Re: Error message "pdo_mysql extension is not installed" during deploy static files

Hello Nisha,

 

Thanks for your reply, the problem was with Wamp Server there are 2 files php.ini (php.ini and phpForApache.ini) and php.ini was empty. I have resolved the problem by copy phpForApache.ini in php.ini.

 

Thanks again for your help. 

Re: Error message "pdo_mysql extension is not installed" during deploy static files

Thanks for the tip; the below worked for me:

sudo chmod -R 777 /opt/lampp/htdocs/magento2/var/cache/

 cd /opt/lampp/htdocs/magento2
 sudo /opt/lampp/bin/php -dmemory_limit=6G bin/magento setup:upgrade
 sudo /opt/lampp/bin/php -dmemory_limit=6G bin/magento setup:di:compile
 sudo /opt/lampp/bin/php -dmemory_limit=6G bin/magento setup:static-content:deploy -f
 sudo /opt/lampp/bin/php -dmemory_limit=6G bin/magento cache:clean