开发者

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


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).


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.


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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜