Here’s a short post on how to fix some common installation problems with Cake PHP 2.2.1. I hope it helps people out there, because I had some issues installing it and spent hours figuring out what was wrong.
- If you’re seeing the following error when you go to the Cake PHP main page on localhost: URL rewriting is not properly configured on your server.
Then go into apache and turn this on in apache modules: rewrite_module.
For me in wamp, I just clicked on the wamp button in the windows tray and went to apache -> apache modules -> rewrite_module.
Then I restarted wamp. I had to do this 3 times before it worked. I have no idea why. Maybe lag?
- If you’re getting this error: CakePHP: Can’t access MySQL database.
Then go into the php.ini (for me I clicked on the wamp button in the windows tray -> PHP -> php.ini) and turn this on: extension=php_pdo_mysql.dll, by getting rid of the semicolon in the front of it. Then restart wamp.
Of course check your database.php file to see if everything is spelled correctly, and make sure that the user (‘login’ => ‘root‘,) you’re using has permission to edit the database ( ‘database’ => ‘cake‘,) you’re connecting to.
- If you’re having routing problems and you’ve made sure that the rewrite_module is on. Then you may have to do this:
Click on the wamp button and go to Apache and then to the httpd.conf file. Then search for <Directory />.
Then make sure that it looks like this in the <Directory /> tags:
Deny from all