472084
472084

Reputation: 17885

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.

Upvotes: 7

Views: 15110

Answers (8)

zarpilla
zarpilla

Reputation: 352

In my case the problem was not the cache. Enabling CakePHP debug should be useful. Change the value to

Configure::write('debug', 0);

to

Configure::write('debug', 1);

in app/cake/core.php to show the real errors.

Upvotes: 1

ionyekanna
ionyekanna

Reputation: 440

In my case i had

public function appError($error) {}

on AppController which was supposed to redirect to a 404 page and i commented the redirect. this led to me having blank page.

Upvotes: 1

Igor L.
Igor L.

Reputation: 3445

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.

Upvotes: 2

Mauricio T.
Mauricio T.

Reputation: 23

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.

Upvotes: 2

Michael Lumbroso
Michael Lumbroso

Reputation: 4983

I had the exact same problem, it was the folder app/tmp/cache/models that didn't exist. After creating it, no more problem.

Upvotes: 0

Hardik Sondagar
Hardik Sondagar

Reputation: 4495

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.

Upvotes: 1

dav
dav

Reputation: 9267

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.

Upvotes: 2

472084
472084

Reputation: 17885

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.

Upvotes: 7

Related Questions