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 -->
5
  • 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. Commented Oct 9, 2013 at 10:16
  • 1
    What does phpinfo() report as effective values? Commented Oct 9, 2013 at 10:17
  • dunc: doesn't work... Alvaro: yes, I've just checked and the values are ok Commented Oct 9, 2013 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? Commented Oct 9, 2013 at 10:28
  • But I just want the errors for 1 site, not others on the server Commented Oct 9, 2013 at 10:43

2 Answers 2

1

You could try.

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

Sign up to request clarification or add additional context in comments.

5 Comments

Please check phpinfo(); and check if the values are changed.
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
after adding lines only one value change: error_reporting 32767
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
Finaly I was successful. I put the code in each php script called from the first one and I have now error messages...
0

put this on top of your php page.

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.