Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CakePHP showing blank page

I have a website that is finished and uploaded, at first it works fine but after a while it stops working.

By stops working I mean whatever page I go to just shows a blank page, empty source.

In Chrome though, I get HTTP Error 500 (Internal Server Error)

To fix this all I need to do is change debug to 2, refresh and then change it back to 0.

I do not know what triggers this to happen, I have tried clearing the cache folders.

There are no log entries in /app/tmp/logs/error from the last week.

Any ideas would be great. Thanks.

like image 759
472084 Avatar asked Jul 13 '12 13:07

472084


5 Answers

In the end it was APC cache conflicts between multiple Cakes on the same server.

All I had to do was change $prefix in config.php and it worked.

like image 81
472084 Avatar answered Nov 11 '22 21:11

472084


Cakephp can show also blank page, if you have some component included in your controller and it contains error, and if for some reason debug does not work(though debug level in core.php is 2 or 3 ) in your component , it just shows blank page.

like image 2
dav Avatar answered Nov 11 '22 21:11

dav


this post is getting old, but today I upload a new website to a server and get the blank page so I share my experience. I have no access to server logs so I was stuck. I was very confused because that server has running another sites with cakephp so I think the problem was mod_rewrite. After several ours of testing the problem was that the server's php version was too old to run cake 2.8.3. so I use an older version of cake and everything works fine. Hope this help someone.

like image 2
Mauricio T. Avatar answered Nov 11 '22 22:11

Mauricio T.


Happened to me when I had a constant defined, did not notice this and defined another one with the same name.

const VISIBLE = 1;
const DELETED = 0;
const VISIBLE = 1;

A few years later I will add a comment here:

This would mean there was a syntax error, make sure u display these.

like image 2
Igor L. Avatar answered Nov 11 '22 22:11

Igor L.


It might be due to white space in end of file Please check your all files if white space is there after ‘?>’ tag it redirects it to blank page or you can remove ‘?>’(closing php tag) to remove this problem.

like image 1
Hardik Sondagar Avatar answered Nov 11 '22 20:11

Hardik Sondagar