Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cakePHP - 404- page not found error, when deploying on a different machine

I'm trying to deploy a cakephp application into my peers system and i get 404 error, for all requests. This is not cakephp 404 error, but a normal webserver 404 page not found error. :( . We both use MAC OS 10.6. The same code works on my machine and on the production system. I have followed the steps to deploy on his machine. I'm using cakephp advanced installation, i.e, webroot contain only index.php, css, js,etc. The APP folder and CAKE folder is located elsewhere.

  1. uncommented the line "LoadModule php5_module...." in /etc/apache2/httpd.conf
  2. Changed to AllowOverride All to the Directory - "Library/WebServer/Documents" in /etc/apache2/httpd.conf
  3. uncommented and set date.timezone in /etc/php.ini
  4. Copied the webroot contents to "Library/WebServer/Documents" and modified index.php to adapt to his machine (setup 3 relevant paths to the CORE, APP and CAKE folder)
  5. made sure the DB connection is good.
  6. For debugging purpose, Modified core.php and set Configure::write('debug',3);

The homepage get data from an AJAX call. WHen i goto http://localhost, the header and footer contents from the layouts/default.ctp are rendered, but the ajax call which is for example http://localhost/posts/showmyposts gets a 404 (Not Found) error. If I goto to other URLs like http://localhost/users/login, I get the normal webserver 404 error.

Not Found

The requested URL /users/login/ was not found on this server.

In my apache error log, i get the error as

[Mon May 16 16:19:48 2011] [error] [client ::1] File does not exist: /Library/WebServer/Documents/users, referer: http://localhost/ Is my cakephp installation correct ?

like image 564
ravi.panch Avatar asked May 16 '11 19:05

ravi.panch


1 Answers

Sounds like an issue with mod_rewrite not working on that machine. What happens when you try to run a default Cake install? Does it load the CSS and all?

Is there a .htaccess file in your app directory (and in your webroot directory)?

Do you have FollowSymLinks turned on in your Apache config files?

like image 146
vindia Avatar answered Oct 18 '22 04:10

vindia