[Solved] PHP error reporting doesn't work

4 posts / 0 new
Last post
#1 Mon, 04/26/2010 - 09:54
Presenter

[Solved] PHP error reporting doesn't work

Hello all,

I currently have a Virtualmin server running... But I would like to be able to view my php errors when I'm quicly editing an existing website. This is a test-code I tried:

<?php

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

    phpinfo()

    echo 'test'

?>

You would expect it would show errors, but it doesn't. Does anybody know what to do to show the errors?

Fri, 05/07/2010 - 08:48
Presenter

isn't there anybody who can help me?

Fri, 05/07/2010 - 10:41
andreychek

Well, looking at this manual on php.net for display_errors:

http://www.php.net/manual/en/errorfunc.configuration.php#ini.display-errors

I see this info which appears to be relevant:

Note: Although display_errors may be set at runtime (with ini_set()), it won't have any affect if the script has fatal errors. This is because the desired runtime action does not get executed.

That is, it's going to be difficult to get what you're after by setting that option in your PHP code... you're probably better off just making the change in the php.ini file, or by simply looking in the Apache error log ($HOME/logs/error_log). You could just SSH into the server, run "tail -f error_log", and have a running list of any errors and warnings that are going on.

-Eric

Tue, 05/18/2010 - 02:48
Presenter

Thanks! I will use SSH and the command you suggested. It's just a new way of working for me...

Topic locked