0

I've read lots of posts here about that but found nothing that worked for me! I need to have php errors displayed on browser for one site. All other site must not. In my php.ini I've

error_reporting = E_DEPRECATED & ~E_STRICT

and

display_errors = On

On My .htaccess I've

php_flag display_startup_errors on
php_flag display_errors on
php_flag html_errors on

I've tried to put

error_reporting(E_ALL);

on the starting of my php script I need to debug, but always I've an error, there is a blank page, and not errors. Nothing more in the log file on the server... I don't understand how to have these errors displayed... Any idea please?

[edit] Starting of my php script:

ini_set('display_errors', 'On');
error_reporting(E_ALL);
include_once("config.php");
include_once("include/functions.php");

function main(){
global $link;
include("header.php");

echo '
<!-- Our Services -->
user2670167
  • 77
  • 5
  • 17
  • Might be worth including 10 or so lines of the code in your script too. I tend to use only two lines at the start of each script: `ini_set('display_errors', 'On');` and `error_reporting(E_ALL)`. Give those a go. – turbonerd Oct 09 '13 at 10:16
  • 1
    What does `phpinfo()` report as *effective* values? – Álvaro González Oct 09 '13 at 10:17
  • dunc: doesn't work... Alvaro: yes, I've just checked and the values are ok – user2670167 Oct 09 '13 at 10:23
  • Set error reporting to on at ini level - might be something during compile that is breaking. Possible duplicate of [How to get useful error messages in PHP?](http://stackoverflow.com/questions/845021/how-to-get-useful-error-messages-in-php) – naththedeveloper Oct 09 '13 at 10:28
  • But I just want the errors for 1 site, not others on the server – user2670167 Oct 09 '13 at 10:43

2 Answers2

1

You could try.

error_reporting(E_ALL);
ini_set("display_errors", 1);

Robert
  • 123
  • 1
  • 9
  • Please check phpinfo(); and check if the values are changed. – Robert Oct 09 '13 at 10:22
  • display_errors On error_reporting 8192 track_errors Off error_append_string no value error_log no value error_prepend_string no value error_reporting 8192 – user2670167 Oct 09 '13 at 10:46
  • after adding lines only one value change: error_reporting 32767 – user2670167 Oct 09 '13 at 10:48
  • 32767 error_reporting is the same as E_ALL, so that should work. Well lets check if .htacces file can make some changes .htacces: php_value error_reporting -1 (-1 stands for complete error reporting) # enable PHP error logging php_flag log_errors on php_value error_log /home/path/public_html/domain/PHP_errors.log – Robert Oct 09 '13 at 11:01
  • Finaly I was successful. I put the code in each php script called from the first one and I have now error messages... – user2670167 Oct 09 '13 at 13:32
0

put this on top of your php page.

 error_reporting(E_ALL);
 ini_set("display_errors", 1);
w3b
  • 823
  • 6
  • 14