CodeIgniter Blank Page

前端 未结 6 1133
深忆病人
深忆病人 2021-01-16 01:43

n00b here. After searching the forums I have not yet come across this problem as I am experiencing it.

I have a CI site that was working correctly until about three

6条回答
  •  梦毁少年i
    2021-01-16 02:48

    Even though there are accepted answers I wanted to add a way that worked for me to figure out this problem.

    Usually the "Blank Page" indicates a PHP parsing error somewhere in the code. Strange thing for me was that on my local MAMP based test server the code ran fine. I FTP it to my hosted server and all of a sudden, blank page of death.

    Even though I had errors on, log errors on, display errors on, nothing appears in any log file.

    I was able to find the error by a funny little trick. I added an echo line in CodeIgniter.php in the system/core. Obviously hacking the core was not a great idea but all I wanted to do was to see how far it was getting in the load process.

    When my echo appeared after trying to load a page on the remote hosted server it also displayed the parsing problem in a derived controller! Not sure why the error did not come out without the "echo" added. But adding it seemed to trigger some output to be generated, IE my echo line and the PHP parse error was appended.

    Not sure if this will help anyone but it turned out to be a nice easy way to find the error which only showed on the remote server.

    Obviously, don't forget to put your core file back to its original state without the echo.

提交回复
热议问题