CodeIgniter project loads blank webpage

后端 未结 3 1169
没有蜡笔的小新
没有蜡笔的小新 2021-01-22 07:45

I have a codeigniter project that I have run successfully on Mac OS X Lion. When attempting to run the same project in ubuntu, requesting localhost/project results in a blank pa

3条回答
  •  旧巷少年郎
    2021-01-22 08:15

    I've ended up with a similar issue only in reverse - worked on Ubuntu but then got nothing on OS X. I did have mysql installed and other sites running just fine on same server. For me there were two culprits, may be this will help you too:

    1. Your logs directory isn't writable. Usually the directory is application/logs unless you have some custom config setup. (http://codeigniter.com/user_guide/general/errors.html) This won't just affect all those log_message(...) function calls, it will also fail when the Loader class tries to load the Log library. If this is the case, changing the logging levels in the config (as often suggested) will not produce any helpful results because, well, CI can't actually write any of the errors.

    2. You might be missing some other php library that is installed on the server where it's working. For me it was a missing memcached php extension so Loader class was also failing when trying to initialize the Session class (a custom extended version of it though). This one might be more difficult to debug if you don't know for certain what extensions are required (like joining in on an existing project with a lot of extras on top of basic CI install). So, next step would be to go and try putting those die(...) statements through the Loader class to see what actually fails to load.

提交回复
热议问题