pyro70
pyro70

Reputation: 89

Debugging CakePHP White Screen of Death

I'm new to CakePHP, so I apologize in advance for my lack of knowledge.

I have a custom CakePHP application that works great on my webhosting account. I've downloaded it to my local machine and I'm trying to get it to run on my WAMP server. I've set up the database correctly, downloaded all the .htaccess files and turned on the Apache rewrite_module but I still get a white screen of death when I open the site in my browser.

Interestingly the apache error log says "File does not exist: C:/wamp/www/favicon.ico". Of course this file should be in the c:/www/aplication_name/app/webroot directory. So for some reason the application is looking at the C:/wamp/www/ directory instead.

The path definitions in webroot/index.php are correct, so I don't know where else the problem could be.

I've been debugging this all day, so any help is appreciated. Thanks, Ben

Upvotes: 1

Views: 5124

Answers (3)

karthikkc
karthikkc

Reputation: 31

I used to get a blank page i.e white screen of death upon login. The reason was I had written $this->autoRender = false; in one of the private functions that gets executed as soon as user logged in.

The way I debugged it: I created a new app and went on pasting functions one by one and kept on check for white screen after login. As soon as I pasted my private function with autorender false I got the white screen and finally fixed the issue after a days hardwork.

Upvotes: 2

vindia
vindia

Reputation: 1678

What's the value of Configure:read('debug') (it is set in config/core.php)? It should be greater than zero, so you'll get PHP errors displayed. Setting debug to zero is for live environments, in development mode you should use a value of 1, 2 or 3 (every level up means more debug information being shown).

If your debug value is set correctly, try to find out if some setting in Apache / PHP is surpressing the PHP error messages regardless of the debug setting (although I think it's highly unlikely that this will be the case).

Upvotes: 2

Leo
Leo

Reputation: 1529

JSo have you configured your virtual host in Apache?

For WAMP in the http-vhosts.conf file add something like

<VirtualHost *:80>

DocumentRoot "d:/websites/myapp/app/webroot/"
ServerName local.myapp

<Directory "d:/websites/myapp/app/webroot/">
    Options -Indexes FollowSymLinks MultiViews
    AllowOverride all
        Order allow,deny
    Allow from all
</Directory>
</VirtualHost>

Then in your windows hosts file i.e. 'C:\windows\system32\drivers\etc\hosts' add

127.0.0.1    local.myapp

Restart Wamp then visiting local.myapp should give you a result.

ADDED-

Do you have display_errors set to 'on' in the php ini file? What does the php error log show you?

Upvotes: 0

Related Questions