CodeIgniter Project Loads Blank Web Page

I have a codeigniter project that I successfully completed on Mac OS X Lion. When trying to start the same project in ubuntu, the localhost / project request results in a blank page without a source.

I added AllowOverride All to apache.conf to no avail. My last strategy was to put the die () operator in strategic places in the index and the included files, trying to find the line on which the code crashed. Using this method, I found in system / core / CodeIgniter.php that the die statement before the line "$ CI = new $ class ();" is executed, while one after it (and, presumably, all the following code) does not.

What can I do with this information to help me run this project locally?

Thanks!

+2
source share
3 answers

I had the same blank page when I started working with CI.

For me, I just forgot to install mySQL on my machine. You do not get errors, because in the system files to connect to the database is preceded by "@", therefore errors are not displayed.

If this is not a problem, check your PHP version or try adding phpinfo () to the index.php file.

+6
source

Did you accidentally put a space or new lines after the end of the PHP tag in some of your files? If so, delete them along with closing the PHP tag.

(PS In a code igniter, you should never close PHP tags in files that contain only PHP code - Controller, Model, ...)

0
source

I ended up with a similar problem only in the reverse order - I worked on Ubuntu, but then did not get anything in OS X. I had mysql installed, and other sites work fine on the same server. There were two culprits for me, maybe this will help too:

  • Your journal directory is not writable. Normally a directory is an application / logs unless you have a custom configuration setting. ( http://codeigniter.com/user_guide/general/errors.html ) This will not only affect all calls to the log_message (...) functions, it will also fail if the Loader class tries to load the log library. If so, changing the logging levels in the configuration (as often suggested) will not bring any useful results, because, in addition, CI cannot write any of the errors.

  • Perhaps you are missing another php library installed on the server where it works. For me, it was the missing memcached php extension, so the Loader class also failed when trying to initialize the Session class (for example, a custom extended version). It can be harder to debug if you don’t know for sure which extensions are needed (for example, join an existing project with a lot of additional features on top of the basic CI installation). So, the next step would be to go and try to put these die (...) expressions through the Loader class to see what it really can't load.

0
source

All Articles