Turning on PHP-Errors/Warnings?

Forum
Last Post
Threads / Messages

FounderSim

Member
Member
Joined
Sep 23, 2014
Messages
65
Points
0
Mysidian Dollar
4,975
At times, I do something screwed up and the page turns blank. It would be nice if I could turn on debugging somehow.

Where is it turned off at in the script so I can turn it on?
 
Mysidia doesn't turn off errors. Fatal errors that cause white pages cannot be helped, they're caused by syntax errors (typos) and the framework isn't prepared to handle that. If no errors appear, then error reporting is turned off at the server level (which is always done on public hosting because they expect people to be hosting production-ready sites) so contact your hosting if you feel they aren't displaying errors and see if it can be turned off just for you (probably not, because hosting is usually shared) (or if you're self-hosting with WAMP, modify the error_reporting parameter in apache's php.ini file).

You should still be able to check your error log regardless (google or ask your hosting provider how to find it).
 
At times, I do something screwed up and the page turns blank. It would be nice if I could turn on debugging somehow.

Where is it turned off at in the script so I can turn it on?

If your host doesn't let you edit the php.ini file, you can put this at the top of your classes/class_appcontroller.php file (it's included in every main page so the errors will show on every page), under the <?php tag:

PHP:
error_reporting(E_ALL & ~E_NOTICE);

And then when you are done debugging, you can just remove that line of code. ^^
 
Mysidia doesn't turn off errors. Fatal errors that cause white pages cannot be helped, they're caused by syntax errors (typos) and the framework isn't prepared to handle that. If no errors appear, then error reporting is turned off at the server level (which is always done on public hosting because they expect people to be hosting production-ready sites) so contact your hosting if you feel they aren't displaying errors and see if it can be turned off just for you (probably not, because hosting is usually shared) (or if you're self-hosting with WAMP, modify the error_reporting parameter in apache's php.ini file).

You should still be able to check your error log regardless (google or ask your hosting provider how to find it).

Hard to believe any framework can't stops syntax errors from displaying.

I guess this means no more typing of 100+lines of code then checking for errors. =(

Thanks @pachoofoosh.
 
Perhaps you might be interested in reading some the responses to the 'white screen of death' on Stackoverflow? It's just a very common PHP thing, but a syntax error handler could be hacked in... I'd sooner just copy and paste my file into a syntax checker.
 
It's always a good idea to learn how to use a development environment on your own private machine before deploying out there to the public web. You can use XAMP, LAMP, or WAMP depending on which you prefer. I personally like WAMP because it has a little control panel on your task bar you can pull up which makes getting to things easier. Then you can fix errors on your development copy, and use Filezilla to upload changes to your live webhost.
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,277
Messages
33,120
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Top