views:

97

answers:

1

I followed this instruction but not worked for me. I just wanna install and config cakephp in my new MacBook Pro and that's why I'm tried to rename my php.ini.default to php.ini. Before that, I had no problem in communicating between my MySQL and Mac pre-installed PHP.

What's wrong with that instruction. ( specially "Getting MySQL and PHP to communicate" part )

BTW it's not permission problem or mysql.sock location I think. I checked them.

Please help me. Thanks

+1  A: 

First let's see if we can get a more detailed error message than "Error connecting to mysql".
What's the output of:

<?php
error_reporting(E_ALL); ini_set('display_errors', 1);
echo 'mysql extension: ', extension_loaded('mysql') ? 'ok' : 'NOT ok', "<br />\n";
echo 'mysql_connect: ', function_exists('mysql_connect') ? 'ok' : 'NOT ok', "<br />\n";
mysql_connect('fill in', 'the right', 'values here') or die(mysql_error());

?

VolkerK
Error was: Warning: mysql_connect(): [2002] Permission denied (trying to connect via unix:///var/mysql/mysql.sock) in /Library/WebServer/Documents/mysqltest.php on line 5 Warning: mysql_connect(): Permission denied in /Library/WebServer/Documents/mysqltest.php on line 5 Permission denied . it was 775 and I chmod it to 777 and problem solved. Many thanks. Thank you VolkerK
Michel Kogan
Wow, that was much quicker than anticipated. Good for you. :)
VolkerK