Jump to:

23001 Posts in 11854 Topics by 2828 members

General Questions

SilverStripe Forums » General Questions » Never can get debug mode working

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1891 Views
  • wifiman
    Avatar
    Community Member
    20 Posts

    Never can get debug mode working Link to this post

    I am not the most advanced PHP programmer, so having a reliable debugging environment is crucial for me as I modify a new Page type in mysite/code. With only one minor PHP typo in this new file, I can cause my entire SilverStripe site to fail (white screens with no content -- both on the public and admin sides). (I can literally cause and solve the problem by changing one file in mysite/code/.

    After reading some other posts, I've tried in vain to add the following two lines to mysite/_config.php to force my SilverStripe installation into dev mode:

    Director::set_environment_type("dev");
    if(Director::isLive()) Debug::send_errors_to("me@email.com");

    I've then issued ad dev/build/?flush=1 for good measure. Even with this step successfully completed, when I put my new .php file into the code folder I cause the site to fail.

    I am running this site on a hosting provider (Omnis.com) and thus I don't have access to the overall Apache server logs (at least, I don't know how to access them). I am sure that I can troubleshoot my PHP issue, if I could only see where my code is failing. Could someone please walk me through what I am doing wrong?

  • ollyp
    Avatar
    Community Member
    3 Posts

    Re: Never can get debug mode working Link to this post

    I had a similar problem. I got e-mail errors working by using

    Debug::send_errors_to("me@me.co.uk");

    in mysite/_config.php
    without any of the other director stuff. Then just make a mail filter, and remove the line when you are finished.

    Olly

  • wifiman
    Avatar
    Community Member
    20 Posts

    Re: Never can get debug mode working Link to this post

    Thanks for the suggestion. I tried that change just now. I still can cause my SS site to go to the White Screen of Death, but I am not getting any emails (and this happens on both the user and admin interfaces). I've changed the email address in your example to my personal account (which is receiving mail just fine today). Usually the failure occurs very quickly, so it's not clear if SS is even still "running" properly at all.

    Is there anything else that I can try to do to help debug these issues in real time -- I'd like to get a line number where the problem is occurring. Hopefully this type of behavior is going to be addressed soon in a future release. I've seen that v2.3.2 is much less forgiving on the PHP debugging front than earlier versions I've used. Is there any hope that v2.3.3 would make a difference for me?

    Why aren't more SS users having this same issue?

  • Willr
    Avatar
    Forum Moderator
    5464 Posts

    Re: Never can get debug mode working Link to this post

    Maybe you have a setting in your php.ini file thats different to most. Make sure display_errors is set to on.

  • wifiman
    Avatar
    Community Member
    20 Posts

    Re: Never can get debug mode working Link to this post

    Aha! That was it -- thanks! That setting is recommended off by my hosting provider -- is it something that I should disable when I am finished with troubleshooting? Or is it safe to leave enabled?

  • pinkp
    Avatar
    Community Member
    168 Posts

    Re: Never can get debug mode working Link to this post

    I have this exact problem! white screen no error reports!
    I've been discussing my problems here http://www.silverstripe.org/all-other-modules/show/270490?showPost=270828

    Where is the "php.ini" file? I'd like to try Willr's suggestion as the reports are not being emailed etc...

    many thanks!

  • dalesaurus
    Avatar
    Community Member
    283 Posts

    Re: Never can get debug mode working Link to this post

    Do what UncleCheese suggested in your other post, using ini_set() in your _config.php. It is exactly the same effect as editing your php.ini.

    No offense intended, but if you don't know how to find your php.ini file you shouldn't be messing with it It impacts php calls on the entire server instead of just your SS ones (which is what the ini_set + _config.php method does).

    1891 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.