Getting the pdo_mysql driver to work in the CLI

I have a problem with the pdo_mysql extension in the CLI. I work with a local installation of LAMPP and create the info.php file. I see that I have PDO and mysql driver. But when I write php --ri mysqlon the command line, it returns Extension 'mysql'. I read both php.ini, the one for the CLI, and the one that loads for the browser, and I don’t see the differences in the pdo setting. PDO is activated for the CLI, but pdo_mysql is not, and I can not find the pdo_mysql.so file or any other file or line that tells me why it works from the browser and not from cli. Any help?

Many thanks.

+3
source share
2 answers

. php, ​​LAMPP, pdo , ( , ubuntu - ) PDO, PDO . CLI PHP, . Doctrine CLI, bash, php-. .doctrine , php :

#!/root/to/lampp/php

( , , , .

+1

ubuntu + mysql ( ) php cli apt sudo apt-get install php5-cli. PDO , db (mysql ) . php --ri pdo, PDO = > enabled PDO drivers = > (blank)

mysql, php5-mysql sudo apt-get install php5-mysql. , , php5-cli. db (, postgres odbc), sudo apt-cache search php5

+5

All Articles