views:

220

answers:

5

I have just moved my CodeIgniter project to a new server and now I'm getting a 500 error and no output from the project. It works fine on my old server and in my test environment. I'm completely stumped how to troubleshoot this, especially as there's nothing of use in the log files. Any help would be great!

A: 

Some ideas for you:

  • Are you sure there is nothing in the log files? Have you checked both the web server's log files as well as the system logs (EG: /var/log/messages)? Have you checked all of the logs enabled in php.ini?

  • Double-check your CI configuration settings. Perhaps you are pointing to the wrong database?

  • Have you confirmed that a basic PHP script <?phpinfo(); ?> works? This would isolate the problem to CI

Justin Ethier
Thanks for the reply.There are no logs about my code in /var/log/messages or the httpd logs.Database is correct and phpinfo() is returning what I expect.
feylya
A: 

Most likely you have not specified the base url for the new location, you can set it from file:

/system/config/config.php

at line:

$config['base_url'] = 'your new url here';
Web Logic
Unfortunately not. That's set to point to the right url.
feylya
@feylya: Is there some sort of url there, htaccess used?
Web Logic
Yup, the value is the correct URL and there is no htaccess being used. The index_page value points to index.php.
feylya
A: 

have you try load a new CodeIgniter project, and try to load in ur test environment? is it work?

From my experiment 500 error normally due with web server problem. But from what your said you didn't have any .htaccess. You better try just load a clean CI project and see your webserver OK or not.

Shiro
A: 

Well, this is embarrassing. I was missing php-mysql. CodeIgniter wasn't logging the fact that it couldn't find it, nothing was appearing in /var/log/messages. Installed it and suddenly, it works. Thanks all for your answers.

feylya
+1  A: 

I get this problem on my live server with SuPHP. To avoid it, all PHP files must have permissions 0644, and directories 0755.

To do this without a headache, do one of the following:

  • Get an FTP client that will upload using permissions you specify
  • Find a PHP script that will change permissions, based on filtering criteria, after upload
  • Get shell access to your host!
Kurucu