Reputation: 3468
Attempting to Cake Bake throws 'php_pdo_mysql.dll' problems:
root@ankan-ad:/opt/lampp/htdocs/resource/newbaker/app# Console/cake bake all
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20121212/php_pdo_mysql.dll' - /usr/lib/php5/20121212/php_pdo_mysql.dll:
cannot open shared object file: No such file or directory in Unknown on line 0
Following this:
Welcome to CakePHP v2.4.6 Console
---------------------------------------------------------------
App : app
Path: /opt/lampp/htdocs/resource/newbaker/app/
---------------------------------------------------------------
Bake All
---------------------------------------------------------------
Error: Database connection "Mysql" is missing, or could not be created.
#0 /opt/lampp/htdocs/resource/newbaker/lib/Cake/Model/ConnectionManager.php(105): DboSource->__construct(Array)
#1 /opt/lampp/htdocs/resource/newbaker/lib/Cake/Console/Command/Task/ModelTask.php(927): ConnectionManager::getDataSource('default')
#2 /opt/lampp/htdocs/resource/newbaker/lib/Cake/Console/Command/Task/ModelTask.php(864): ModelTask->getAllTables('default')
#3 /opt/lampp/htdocs/resource/newbaker/lib/Cake/Console/Command/Task/ModelTask.php(954): ModelTask->listAll('default')
#4 /opt/lampp/htdocs/resource/newbaker/lib/Cake/Console/Command/BakeShell.php(150): ModelTask->getName('default')
#5 /opt/lampp/htdocs/resource/newbaker/lib/Cake/Console/Shell.php(437): BakeShell->all()
#6 /opt/lampp/htdocs/resource/newbaker/lib/Cake/Console/ShellDispatcher.php(207): Shell->runCommand('all', Array)
#7 /opt/lampp/htdocs/resource/newbaker/lib/Cake/Console/ShellDispatcher.php(66): ShellDispatcher->dispatch()
#8 /opt/lampp/htdocs/resource/newbaker/app/Console/cake.php(36): ShellDispatcher::run(Array)
#9 {main}
Solutions tried:
'unix_socket' => '/opt/lampp/var/mysql/mysql.sock'
to my database.php default array does not helpAm I doing something wrong in the php.ini files?
The following are all the uncommented lines in php.ini that have 'extension='
Output of grep -Hrvn ";" /etc/php5 | grep -i "extension="
/etc/php5/cli/php.ini:4:extension=php_pdo_mysql.dll
/etc/php5/mods-available/opcache.ini:3:zend_extension=opcache.so
/etc/php5/mods-available/pdo.ini:3:extension=pdo.so
/etc/php5/mods-available/readline.ini:3:extension=readline.so
/etc/php5/mods-available/json.ini:3:extension=json.so
/etc/php5/apache2/php.ini:4:extension=php_pdo_mysql.dll
Upvotes: 1
Views: 681
Reputation: 20440
It looks like there are two problems:
extension
lines from a Windows php.ini. Linux does not use DLLs, and furthermore PHP on Ubuntu generally has no extensions specified in the main ini file at all. Instead you just load the extensions you need from the standard software repositorysudo apt-get install php5-mysql
to get this loaded and installedAs an extra thought, if you want to see what's available for PHP, try apt-cache search php5-
- that will let you see all the things you can load.
Upvotes: 3