7

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.

472084
  • 17,666
  • 10
  • 63
  • 81
  • 2
    Look at your server logs. Blank pages are almost always some sort of fatal PHP error. – ceejayoz Jul 13 '12 at 13:20
  • If you have cPanel, you can view the error logs in there usually. – Dave Jul 13 '12 at 13:42
  • Plesk's only log was `copy_file: System Error: invalid file paths in /usr/local/psa/admin/bin/copy_file /var/www/vhosts/***/statistics/logs/xferlog_regular -:` – 472084 Jul 13 '12 at 13:58

8 Answers8

7

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.

472084
  • 17,666
  • 10
  • 63
  • 81
2

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.

dav
  • 8,931
  • 15
  • 76
  • 140
2

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.

Igor L.
  • 3,159
  • 7
  • 40
  • 61
2

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.

1

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.

Hardik Sondagar
  • 4,347
  • 3
  • 28
  • 48
1

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.

Bibhudatta Sahoo
  • 4,808
  • 2
  • 27
  • 51
ionyekanna
  • 440
  • 5
  • 7
1

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.

zarpilla
  • 353
  • 3
  • 6
0

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

Michael Lumbroso
  • 4,931
  • 5
  • 27
  • 34