In the past I had installed MySQL as part of XAMPP in /Applications/XAMPP/ and the PHP that the system used (e.g. from command line) used /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock to connect with MySQL.

Now I have installed MySQL 5 with macports and I want my system PHP to be able to use that. I think I must set PHP to use /opt/local/var/run/mysql5/mysqld.sock but where do I set this? Is there a php.ini for CLI PHP?

link|improve this question
feedback

1 Answer

There should be a php-cli.ini in /opt/local/etc/ (or where-ever PHP is installed). It should be in the same folder as your normal php.ini is in. If it's not, copy php.ini-dist or php.ini (which should also be in the same folder) to php-cli.ini.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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