Php Cannot Display Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more
Error Reporting Php Ini
about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users php.ini display_errors Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping
Php Error Reporting All
each other. Join them; it only takes a minute: Sign up Can't get PHP to report errors up vote 6 down vote favorite I can't see any PHP errors. I have tried every trick I can find to turn php error checker error reporting on, but nothing works. display_errors is on and error_logging is on, but when I view any page with an error, I get a blank page. /var/log/php.log does not exist. if I set a local logfile, Nothing gets created. The file I have been testing with is any other ideas? php error-reporting share|improve this question asked Aug 30 '10 at 23:02 Nathan 3,27152950 add a comment| 4 Answers php error log 4 active oldest votes up vote 1 down vote accepted You probably need to set it in .htaccess, httpd.conf or php.ini (depending on your server or hosting company). You most likely have a parse error, which means your script never gets to the point where it can turn on the error reporting. share|improve this answer answered Aug 30 '10 at 23:31 Hans 1,51011426 2 I tried your code and it works on the command line, I wonder if you have a setup that refuses to show output of phpinfo() (for security reasons) and you are seeing a valid, though still blank, page. See what 'disable_functions' is set to, if you can. –Hans Aug 30 '10 at 23:37 Is there some way to force php to report parse errors? –Nathan Aug 30 '10 at 23:38 2 @Nathan did you select this answer b/c it was helpful or for different reasons? I am having the same problem and as is I don't find it too helpful. Hans, perhaps if you mentioned how to check to see if one has a parse error. –puk Mar 14 '12 at 9:28 add a comment| up vote 1 down vote Have you tried editing the actual ini file as opposed to trying to change it at runtime? You can also try using ini_get('display_errors'); to see if your change took effect. If
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack
Php Error Handling
Overflow the company Business Learn more about hiring developers or posting ads with us php throw error Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community
Php Force Error Reporting
of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How do I get PHP Errors to display? up vote 679 down vote favorite 204 I http://stackoverflow.com/questions/3604863/cant-get-php-to-report-errors have checked my PHP ini file and display errors is set and also error reporting is E_ALL. I have restarted my apache web server. I have even put these lines at the top of my script and it doesn't even catch simple parse errors. For example, I declare variables with a "$" and I don't close statements";". But all my scripts show a blank page on these errors, but i want http://stackoverflow.com/questions/1053424/how-do-i-get-php-errors-to-display to actually see the errors in my browser output. error_reporting(E_ALL); ini_set('display_errors', 1); What is left to do? php error-reporting share|improve this question edited Mar 9 at 7:16 Maninderpreet Singh 1,7111524 asked Jun 27 '09 at 19:09 Abs 13.4k68209356 3 I've yet to nail down exactly why this works sometimes and not others, but for anyone wanting to quickly toggle errors in a php script (or enable them via a $_REQUEST parameter) these two lines will work most of the time. –brandonscript Oct 28 '13 at 20:15 well you can see details of the error by enabling xdebug from php ini file. –jewelhuq Jan 13 at 10:14 add a comment| 13 Answers 13 active oldest votes up vote 1359 down vote accepted This always works for me: ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); However, this doesn't make PHP to show parse errors - the only way to show those errors is to modify your php.ini with this line: display_errors = on share|improve this answer edited Oct 23 '15 at 12:24 tleb 1,173721 answered Jan 29 '14 at 11:25 Fancy John 14k2915 4 why is this not the best answer? –özg Jul 4 '14 at 11:52 13 @özg Because this configuration doesn't show parser errors (errors due to syntactically incor
and Objects Namespaces Errors Exceptions Generators References Explained Predefined Variables Predefined Exceptions Predefined Interfaces and Classes Context options and parameters Supported Protocols and Wrappers Security Introduction General considerations Installed as CGI http://php.net/manual/en/function.error-reporting.php binary Installed as an Apache module Session Security Filesystem Security Database Security Error Reporting Using Register Globals User Submitted Data Magic Quotes Hiding PHP Keeping Current Features HTTP authentication with PHP Cookies Sessions Dealing with XForms Handling file uploads Using remote files Connection handling Persistent Database Connections Safe Mode Command line usage Garbage Collection DTrace Dynamic Tracing Function Reference Affecting php error PHP's Behaviour Audio Formats Manipulation Authentication Services Command Line Specific Extensions Compression and Archive Extensions Credit Card Processing Cryptography Extensions Database Extensions Date and Time Related Extensions File System Related Extensions Human Language and Character Encoding Support Image Processing and Generation Mail Related Extensions Mathematical Extensions Non-Text MIME Output Process Control Extensions Other Basic Extensions Other Services Search Engine Extensions Server php cannot display Specific Extensions Session Extensions Text Processing Variable and Type Related Extensions Web Services Windows Only Extensions XML Manipulation Keyboard Shortcuts? This help j Next menu item k Previous menu item g p Previous man page g n Next man page G Scroll to bottom g g Scroll to top g h Goto homepage g s Goto search(current page) / Focus search box restore_error_handler » « error_log PHP Manual Function Reference Affecting PHP's Behaviour Error Handling Error Handling Functions Change language: English Brazilian Portuguese Chinese (Simplified) French German Japanese Korean Romanian Russian Spanish Turkish Other Edit Report a Bug error_reporting (PHP 4, PHP 5, PHP 7)error_reporting — Sets which PHP errors are reported Description int error_reporting ([ int $level ] ) The error_reporting() function sets the error_reporting directive at runtime. PHP has many levels of errors, using this function sets that level for the duration (runtime) of your script. If the optional level is not set, error_reporting() will just return the current error reporting level. Parameters level The new error_reporting level. It takes on either a bitmask, or named c