Hi Friends
How do you disable warnings in PHP in the hosting?
Thanks =)
How do you disable warnings in PHP?
- exterminator
- New to forums
- Posts: 12
- https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
- Joined: Fri Nov 16, 2012 10:29 pm
Re: How do you disable warnings in PHP?
These should be disabled by default. Most of the time, when I see them, it's because the application reenabled them. What warning are you seeing that needs to be disabled?
- exterminator
- New to forums
- Posts: 12
- Joined: Fri Nov 16, 2012 10:29 pm
Re: How do you disable warnings in PHP?
Code: Select all
Warning: Division by zero in /usr/www/personalserver/mysite/main.php on line 70
Warning: Division by zero in /usr/www/personalserver/mysite/main.php on line 71
Re: How do you disable warnings in PHP?
It would be best to fix the root cause of that (the division by zero) by editing the source. But, if you'd prefer to just hide the warning, you will need to look for where in your application it is using the error_reporting() function and comment those lines out.
- Vanderburg
- Former staff
- Posts: 1253
- Joined: Sat Nov 13, 2010 7:27 am
- Location: Dallas, TX
Re: How do you disable warnings in PHP?
I believe you can just add an @ at the beginning of a function to prevent it from spitting out an error, too, but it's not always a very good idea.
- exterminator
- New to forums
- Posts: 12
- Joined: Fri Nov 16, 2012 10:29 pm
Re: How do you disable warnings in PHP?
In other host..works fine ... my friend have bluehost. ¿what is happening?
- exterminator
- New to forums
- Posts: 12
- Joined: Fri Nov 16, 2012 10:29 pm
Re: How do you disable warnings in PHP?
any ideas?:(
Re: How do you disable warnings in PHP?
Fixing the bug in the code is still the best idea. Disabling warnings through your application or .htaccess is the second-best idea.