Quantcast
Channel: Guide pour le framework Symfony
Viewing all articles
Browse latest Browse all 10

Symfony, MAMP, PhpMyAdmin, password changed…

$
0
0

I use MAMP to run all the things needed to develop web sites with symfony (php based framework). Even if I am not 100% satisfied, I did not find any other solution and I must admit it is pretty simple to install. I won’t come back with installation process and symfony compatibility, there are several good posts, the best one being this one (according to me !)

But even if this post, I was unable to set up properly virtual hosts, which is unconvenient but doesn’t prevent you from using MAMP. I relocated my web projects in a different directory from the one used by mamp (the htdocs directory). This is easy to do, you just have to go to "preferences" (when you click on the MAMP icon) then "apache" and upload the root directory.

But then I changed the sql password… and I was unabled to access to PhpMyAdmin any more !! I had a message error of the following type : "sql error, cannot find sql server on localhost" or something like that… So after hours of searches on the net and in my brain, I finally solved this problem. You just have two things to change.

First, give MAMP the new password you set up for your database.
Go to /MAMP/bin/MAMP/index.php and change line 15 to this :

//.../MAMP/bin/MAMP/index.php
$link = @mysql_connect(':/Applications/MAMP/tmp/mysql/mysql.sock', 'root', 'myNewPassword');

Then, you will still be unable to connect to phpMyAdmin, so you have another thing to do, its to change the authentification setting from ‘config’ to cookie.
For this, go to /MAMP/bin/PhpMyAdmin/config.inc.php on line 84 and change the line to this :

//.../MAMP/bin/PhpMyAdmin/config.inc.php
$cfg['Servers'][$i]['auth_type']     = 'cookie';    // Authentication method (config, http or cookie based)?

Now you will be asked to enter by hand your db name and password, and this it, you can acces to PhpMyAdmin !!!!

By the way, I faced another problem and couldn’t find the solution on the net so it might be useful for some one facing the same issue. When doing a "build-all-reload" on symfony, I suddenly had the following error message : "Couldn’t locate driver named mysql". After several tries, I ended up solving the problem. For a reason I still ignore, the symbolic links that you create when installing MAMP for symfony (to replace by default MAC apache and sql servers) were no more existing !! So just recreate them by typing the following lines in the terminal and every thing should work well :

sudo mv /usr/bin/php /usr/bin/php-old
sudo ln -s /Applications/MAMP/bin/php5/bin/php /usr/bin/php
sudo mv /usr/bin/pear /usr/bin/pear-old
sudo ln -s /Applications/MAMP/bin/php5/bin/pear /usr/bin/pear
sudo mv /usr/bin/mysql /usr/bin/mysql-old
sudo ln -s /Applications/MAMP/Library/bin/mysql /usr/bin/mysql

I stil have trouble installing Xdebug but I will tell you as soon as it will be solved ! Hope it helped…



Viewing all articles
Browse latest Browse all 10

Trending Articles