Conversation
supportHi. I get the mkdir(): File exists PHP Warning on frontend at wp-content/plugins/phastpress/sdk/phast.php:182 . Env details: PHP: 8.1.18 Web server: nginx/1.22.1 WordPress: 6.2.2 Theme: Engitech 1.6.1
This is not a bug. At least not in this plugin. The “@” error suppression operator is used to prevent this warning from being logged, as it is expected during normal operation. Query Monitor apparently does not respect this.
@kiboit Hi, thanks for the answer. https://www.php.net/manual/en/language.operators.errorcontrol.php – here it is stated that – quote ” Prior to PHP 8.0.0, it was possible for the @ operator to disable critical errors that will terminate script execution. For example, prepending @ to a call of a function which did not exist, by being unavailable or mistyped, would cause the script to terminate with no indication as to why. “ Is this somehow related to why Query Monitor ignores the @ operator ? — As i understand we can ignore these errors caught by QM at frontend .
@kiboit I deactivated Query Monitor and instead used this snippet of code : ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); The warning doesn’t appear. Thanks.
That quote is about critical errors. This concerns a warning which is not a critical error. It is up to custom error handling code, such as that implemented by Query Monitor, to respect error suppression. But something changed in PHP 8 that means that Query Monitor’s code needs to be updated in order to correctly detect suppressed errors. I’ve left a note on Query Monitor’s support forum. If they get around to updating this, it should make sure that these suppressed errors show up as such in Query Monitor.
@kiboit Thanks for the feedback !
This is not a bug. At least not in this plugin. The “@” error suppression operator is used to prevent this warning from being logged, as it is expected during normal operation. Query Monitor apparently does not respect this.
@kiboit Hi, thanks for the answer. https://www.php.net/manual/en/language.operators.errorcontrol.php – here it is stated that – quote ” Prior to PHP 8.0.0, it was possible for the @ operator to disable critical errors that will terminate script execution. For example, prepending @ to a call of a function which did not exist, by being unavailable or mistyped, would cause the script to terminate with no indication as to why. “ Is this somehow related to why Query Monitor ignores the @ operator ? — As i understand we can ignore these errors caught by QM at frontend .
@kiboit I deactivated Query Monitor and instead used this snippet of code : ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); The warning doesn’t appear. Thanks.
That quote is about critical errors. This concerns a warning which is not a critical error. It is up to custom error handling code, such as that implemented by Query Monitor, to respect error suppression. But something changed in PHP 8 that means that Query Monitor’s code needs to be updated in order to correctly detect suppressed errors. I’ve left a note on Query Monitor’s support forum. If they get around to updating this, it should make sure that these suppressed errors show up as such in Query Monitor.
@kiboit Thanks for the feedback !