Mysql for php-cli

software development


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, 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?


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


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


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.