3
ralfe@ralfe:/opt/lampp/htdocs/amboim$ bin/magento setup:di:compile
Compilation was started.
Proxies code generation... 0/7 [>---------------------------]   0% 1 sec 42.0 Mi
Proxies code generation... 1/7 [====>-----------------------]  14% 1 sec 46.0 Mi
Repositories code generation... 1/7 [====>-----------------------]  14% 1 sec 46
Repositories code generation... 2/7 [========>-------------------]  28% 6 secs 1
Service data attributes generation... 2/7 [========>-------------------]  28% 6 
Service data attributes generation... 3/7 [============>---------------]  42% 6 
Application code generator... 3/7 [============>---------------]  42% 6 secs 134
Application code generator... 4/7 [================>-----------]  57% 16 secs 15
Interceptors generation... 4/7 [================>-----------]  57% 16 secs 152.0
Interceptors generation... 5/7 [====================>-------]  71% 26 secs 170.0
Area configuration aggregation... 5/7 [====================>-------]  71% 26 sec
Area configuration aggregation... 6/7 [========================>---]  85% 37 sec
Interception cache generation... 6/7 [========================>---]  85% 37 secs
Interception cache generation... 7/7 [============================] 100% 46 secs
Interception cache generation... 7/7 [============================] 100% 46 secs 242.0 MiB

Generated code and dependency injection configuration successfully.
We're sorry, an error occurred. Try clearing the cache and code generation directories. By default, they are: var/cache, var/di, var/generation, and var/page_cache.

[Zend_Db_Adapter_Exception]           
pdo_mysql extension is not installed  

I'm using ubuntu and Xampp as Server

mangento

  • Can you run compiler with -vvv option like bin/magento setup:di:compile -vvv and add output of php -m – KAndy Dec 26 '16 at 18:45
  • pdo_mysql extension is not installed Exception trace: () at /opt/lampp/htdocs/amboim/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:328 @KAndy – Ralfe Dec 27 '16 at 7:02
  • php -m [PHP Modules] calendar Core ctype date dom exif fileinfo filter ftp gettext hash iconv json libxml mcrypt openssl pcntl pcre PDO Phar posix readline Reflection session shmop SimpleXML sockets SPL standard sysvmsg sysvsem sysvshm tokenizer wddx xml xmlreader xmlwriter xsl Zend OPcache zlib [Zend Modules] Zend OPcache @KAndy – Ralfe Dec 27 '16 at 7:03
3

To install the missing pdo-mysql extension in Ubuntu, run

sudo apt-get install pdo-mysql php7.0-mysql

or if you run PHP 5

sudo apt-get install pdo-mysql php5-mysql
  • 1
    Doing this, i'm getting this error: Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package pdo-mysql I'm using ubuntu – Ralfe Dec 27 '16 at 17:42
  • 1
    Same issue as @Ralfe E: Unable to locate package pdo-mysql Guess something has changed since last year. – Mohammed Joraid Jul 8 '17 at 0:38
  • @Joraid later versions already have PDO installed with PHP, you only might need to enable it, see: askubuntu.com/questions/824485/… – Fabian Schmengler Jul 10 '17 at 6:32
  • @FabianSchmengler yeah, guess that was the issue. It's solved now. First time for me to install Magento on a web environment from scratch. As you mentioned, Install, Activate, Restart. Thank you for the link, will use it as a future reference. Totally appreciated. – Mohammed Joraid Jul 10 '17 at 21:23
1

In your system is installed PDO but do not installed a driver for MySQL. Please install (or enable) PDO_Mysql extension.

  • I just enbale this two files, by going through the opt/lampp/etc/php.ini But the problem still the same.(extension=php_pdo_mysql.dll extension=php_mysqli.dll) i'm using ubuntu @KAndy – Ralfe Dec 27 '16 at 17:39
  • 1
    Can you verify that php -m contains pdo_mysql in list – KAndy Dec 27 '16 at 18:09
  • No, i can't find any pdo_mysql . What can i do to enable this? – Ralfe Dec 27 '16 at 20:47
  • Try run command php -i|grep 'Loaded Configuration File'. It will output path to used php.ini. Try enable pdo_mysql in this file – KAndy Dec 27 '16 at 21:03
  • now i'm getting this error: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_pdo_mysql.dll' - /usr/lib/php/20151012/php_pdo_mysql.dll: cannot open shared object file: No such file or directory in Unknown on line 0 – Ralfe Dec 28 '16 at 6:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.