Opened 7 years ago
Last modified 2 weeks ago
#45958 new defect (bug)
Errors displayed on shutdown handler
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Bootstrap/Load | Keywords: | has-screenshots has-patch reporter-feedback needs-test-info close |
| Focuses: | multisite | Cc: |
Description
PHP errors are displayed on shutdown handler screen for REST API requests.
See attached screenshot.
Attachments (7)
Change History (23)
This ticket was mentioned in Slack in #core-php by spacedmonkey. View the logs.
7 years ago
#5
@
7 years ago
The issue is related to this line, that only hide errors on some conditions. Above is a list of conditions that public facing but are not XMLRPC_REQUEST, REST_REQUEST, WP_INSTALLING, Admin ajax or a JSON request.
#7
@
7 years ago
- Keywords has-patch needs-testing added; needs-patch removed
45958.diff first patch.
Simple change, just don't display error message for all requests.
#8
@
7 years ago
I think the patch breaks the WP_DISPLAY_DEBUG constant, as it is set early, and you're now overriding it no matter what. This line is meant to represent the exceptions for WP_DISPLAY_DEBUG is actually set to true. In such a case, the filtered requests you saw in the changed line here still need to not display anything to avoid breaking the response.
I had already looked into this as well, and the main problem is that the shutdown handler should decide whether or not to display the error, but at the moment the shutdown handler receives control, PHP has already printed the error.
This ticket was mentioned in Slack in #core-php by schlessera. View the logs.
7 years ago
#10
@
7 years ago
- Milestone changed from Awaiting Review to 5.1
Adding to the 5.1 milestone for tracking.
#11
@
7 years ago
- Milestone changed from 5.1 to Awaiting Review
This issue is not related to any changes made by or for Servehappy, therefore it's not relevant for the 5.1 milestone. Even without having the new PHP error template, that message would have been printed out if the server is configured like that.
The problem here is, as pointed out before, that WordPress does not actually disable displaying errors, even when WP_DEBUG_DISPLAY is not true. It only does so for some request types, for example AJAX requests. As far as I'm aware the issue has been raised before, but not been considered valid, as the server configuration should be responsible for that. I'm personally open to revisiting this, but it's not related to Servehappy, therefore I'll put it back to Awaiting Review.
#14
@
7 years ago
@SergeyBiryukov still valid, it is about the errors showing at all. See the screenshots.
This ticket was mentioned in Slack in #core-site-health by afragen. View the logs.
6 years ago
#16
@
2 weeks ago
- Keywords reporter-feedback needs-test-info close added; needs-testing removed
- Priority changed from high to normal
I'm confused about this error
According to load.php you need either WP_DEBUG to true and WP_DISPLAY_ERRORS to false or you need to set your server config to display_errors manually to 0 (or add the display_errors in your wp-config.php or whatever executable). There is no middle ground. If you don't have this managed server level, and you don't add the right variables, errors going to be displayed anywhere, not just in those pages you have provided
Maybe I'm missing some context because this ticket is 7 years old, so we need more detailed testing instructions.
cc @spacedmonkey
PS: Why multisite focus has been also added?
This ticket is confusing, maybe because it has not aged well, worth considering closing by now.
This also happens on RSS feeds