Tag: Display error in PHP application

Skip or Hide PHP errors / warnings

Errors are hints from compiler for the programmer to correct. But sometimes we face some unwanted or dynamic error. For example, $content = file_get_contents(https://blog.openshell.in/2011/01/execute-php-script-from-command-line-in-ubuntu/); Here , the url is invalid, or the server of the url is down , PHP shows Warning: Failed to open stream or file access is disabled. Use @ in front …

Continue reading

Permanent link to this article: https://blog.openshell.in/2011/01/skip-or-hide-php-errors-warnings/

Set error reporting level to maximum

Configure your development environment to display all PHP warnings, notices and errors. This will help you code better and also help in catching potential bugs early in development phase. You can change the error reporting level at runtime by adding the following code at the top of your PHP script: <?php // Report all PHP …

Continue reading

Permanent link to this article: https://blog.openshell.in/2010/11/set-error/