I use Nginx + php7.0-fpm. Some errors are not visible to the system - error log is clear.
Add the following string in the index.php
file right after the application initialization:
// Instantiate the application.
$app = JFactory::getApplication('site');
$nonexistent = null;
echo $nonexistent->nonexistent() + $abcd;
You will see the Joomla! error page (see the screenshot - with a strange error 0), but in the error log you will not find the error. But if you write the following:
// Instantiate the application.
$app = JFactory::getApplication('site');
echo $nonexistent;
You will see the notice in the log.
Debian 8.
Nginx + php7.0-fpm.
Joomla! RC2.
Error reporting: development (the same with none
).
P.S. I discovered such behaviour when I was debugging a component, but it was impossible to find an error, because the error log was clear, and the Joomla! error page does not point to the broken file and string number -- It just gives a strange error 0 without any localization.
Labels |
Added:
?
|
Title |
|
Category | ⇒ | Libraries |
Title |
|
Priority | Medium | ⇒ | Low |
Title |
|
The debug console is not showing at all!
I assume, it is because of a fatal error. If you add the wrong code at the beginning of the file, you can see in the log:
2017/04/11 17:51:40 [error] 508#508: *4755 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to a member function nonexistent() on null in /home/ozon/web/dev.addondev.com/index.php:19
But when it goes after the application instantiation, you have an error 0 and the clear error log.
Joomla doesn't do anything to alter PHP's internal error logging, unless it is affected by us changing display_errors or calling error_reporting()
, in which case it would still be coupled to PHP's configuration.
@mbabker
If you write wrong code at the beginning of the index.php file, you will have a fatal error logged. When adding the same wrong code after the application instantiation, you will have an error 0 and the clear log. My configuration is standard PHP7.0-fpm configuration, the same as Nginx.
Depends on the type of error thrown. PHP 7 Throwables will get caught in Joomla's exception handling layer, and this includes some things in PHP 5 that would trigger notices, warnings, and errors.
@mbabker, I mean the same error. I'll explain again.
Add the wrong code at the beginning of the index.php
define('JOOMLA_MINIMUM_PHP', '5.3.10');
$nonexistent = null;
echo $nonexistent->nonexistent() + $abcd;
You will have an error logged
2017/04/11 18:14:56 [error] 509#509: *4875 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to a member function nonexistent() on null in /home/user/web/dev.addondev.com/index.php:15
Then add the same code after Joomla instantiate the application:
// Instantiate the application.
$app = JFactory::getApplication('site');
$nonexistent = null;
echo $nonexistent->nonexistent() + $abcd;
The fatal error becomes error 0 and does not go into the log. And in the browser console you have the error description:
The above shows another issue. Why Joomla! demonstrates the server errors to everyone? It is a security issue, because you cannot disable it, even if you set the error_reporting param as none
Status | New | ⇒ | Discussion |
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-05-13 04:37:25 |
Closed_By | ⇒ | franz-wohlkoenig |
Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/15215
closed as having PR #15994
What happens with the system debug plugin enabled ?