Carry_Smith Posted September 2, 2022 Share Posted September 2, 2022 (edited) I have checked my PHP ini file (php.ini) and display_errors is set and also error reporting is E_ALL. I have restarted my Apache webserver. I have tried all things those are mentioned here ( show all php errors ). 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 to actually see the errors in my browser output. PHP Code : error_reporting(E_ALL); ini_set('display_errors', 1); Edited September 4, 2022 by requinix removing link Quote Link to comment https://forums.phpfreaks.com/topic/315267-how-to-get-php-errors/ Share on other sites More sharing options...
Barand Posted September 2, 2022 Share Posted September 2, 2022 Are you sure you are checking the php.ini file that is actually being used? phpinfo() which tell you the correct one. Quote Link to comment https://forums.phpfreaks.com/topic/315267-how-to-get-php-errors/#findComment-1600018 Share on other sites More sharing options...
Barand Posted September 2, 2022 Share Posted September 2, 2022 PS... and have you got "display_startup_errors" set ON. Quote Link to comment https://forums.phpfreaks.com/topic/315267-how-to-get-php-errors/#findComment-1600019 Share on other sites More sharing options...
gizmola Posted September 3, 2022 Share Posted September 3, 2022 If the script doesn't parse, that could be a reason you are not seeing errors. Since most editors catch these types of problems in advance, I'm not sure why you would not fix them in advance. You can also use the command line linter with php -l sourcefile.php. Sometimes this trick can help get around the problem of a stubborn parsing error that causes a 500 error: Make a script named something like debug.php: <?php //debug.php error_reporting(E_ALL); ini_set("display_errors", 1); require("filewitherrors.php"); Quote Link to comment https://forums.phpfreaks.com/topic/315267-how-to-get-php-errors/#findComment-1600046 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.