We experienced a problem when attempting to move one of our codeigniter (CI) websites from one server to another. We performed the transfer of the files, database setup, and necessary config file changes. Then came time to test, and… Nothing. FireFox and IE7 both rendered a blank page.
We tracked down the problem, by setting up test points within the php code. Basically we’d put a ‘print “test” ‘ command in various places, and if it was successfully displayed, then the code was breaking after that point.
Starting with the index.php file, the breaking points were as follows:
<base_path>/index.php (approx. line 117)
<base_path>/system/codeigniter/CodeIgniter.php (approx. line 80)
$EXT =& load_class(’Hooks’);
<base_path>/system/libraries/Hooks.php (approx. line 43)
log_message(’debug’, “Hooks Class Initialized”);
Okay, so the “log_message” was causing the problem. After searching the CI user guide, we found the Error Handling page. At the bottom, it states:
Note: In order for the log file to actually be written, the “logs” folder must be writable. In addition, you must set the “threshold” for logging. You might, for example, only want error messages to be logged, and not the other two types. If you set it to zero logging will be disabled.
So, possibly this was a permissions issue on the logs folder.
To solve the problem, we navigated to our server, and changed the permissions to 777 (read/write/execute across the board) for the logs folder (<base_path>/system/logs).
[localhost]$ chmod 777 system/logs
We did this via ssh, but you could also use some other file manager or possibly ftp on some servers.
…And voila! Our site threw us a database error.
We had never been so happy about a database error before! With the problem isolated, we quickly solved the issue, and got the website rolling.