Class “Configure” not found with development setup
Usually I use a production or an advanced setup when setting up a CakePHP project, even on my development machine. To verify an issue with NoseRub I had to use a development setup. As I tried to access the application via http://localhost/noserub I got the following error:
Fatal error: Class 'Configure' not found in /var/www/noserub/app/config/core.php on line 43
At first I wondered what I did wrong. Then I realized I forgot to set “AllowOverride All” in the Apache configuration file (/etc/apache2/sites-available/default). So I had to add the following snippet to the aforementioned file and restart Apache to make it work:
<Directory /var/www/noserub/>
AllowOverride All
</Directory>
Maybe this will help someone else who encounters the same error…




Any time you run into problem with running your application the first time, here are few things you should look at:
1- Make sure the index.php in the webroot of app points to correct location of cake core
define(’CAKE_CORE_INCLUDE_PATH’, ‘/your-path-to/cakePHP’);
2-(Assuming you are using .htaccess for rewriteRules then: )
Make sure .htaccess files exist in app folder and in app/webroot
3-Make sure you allow .htaccess for the app
Check if you have enabled it, by doing like this
AllowOverride All
4- Make sure you restart apache if you have not done so after changing conf file
5- Make sure tmp folder exists in app
6- Make sure tmp is own by apache ( or at least read/write-able by the web server )
You will see a message similar to this if tmp is inaccessible:
Warning: fopen(app/tmp/logs/error.log) [function.fopen]: failed to open stream: Permission denied in cakePHP/cake/libs/file.php on line 120
7- Make sure tmp folder does not include obsolete files.
- Sometimes you change the table structure (add/delete fields) or insert new data into database by hand (e.g via phpMyAdmin), cake will not update the models’s cache and you’ll run into problem.
- cake uses the class.paths.php in the cache to load files so if tmp is a result of its being copied from somewhere else, class.paths.php will contain paths which are not appropriate for your current application
You can try to empty tmp.
Zonium
@Zonium: Thanks for this list!
just a little fix m8,
AllowOverride All
w00t didn’t paste my entire comment, just add a ‘/’ to Directory closing tag, e.g: —>
@defunkxp: Good eye, it’s now fixed in the article. Thanks!