Mysql for php-cli

software development

#1

I need to transfer data from mysql to mongodb.
And I think use php-cli to write a php program run on command line would be a good way to solve this.
But after I installed php-cli. I found that it didn’t load mysql.so, and I can’t find that in /etc/php5/cgi/php.ini either. Maybe cgi one is made by compile option.

Somebody knows how to setup mysql support for php-cli?


#2

Back up, and uninstall the php-cli package. It’s already installed at /usr/local/php5/bin/php, with mysql support built in.


#3

But before I install php-cli, I can’t find the folder /etc/php5/cli


#4

Yes, Debian’s PHP CLI uses a slightly different configuration path than ours. Our copy uses the same configuration as php5-cgi, at /etc/php5/cgi/php.ini.