| Summary: | RFE: enable default error logging in PHP to a log file | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Vincent Danen <vdanen> |
| Component: | php | Assignee: | Joe Orton <jorton> |
| Status: | CLOSED WORKSFORME | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | rawhide | CC: | fedora, jorton, rpm |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2012-06-22 12:04:10 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
|
Description
Vincent Danen
2011-09-28 15:33:23 UTC
On a side note, I did realize after-the-fact that log_errors being on, and without an error_log defined, will put PHP errors/warnings into the Apache logs (since we have LogLevel warn defined). I still think that a system-wide default makes sense as well, though. What do you mean by "system wide default"? /etc/php.ini is the system wide default. For the cgi/cli SAPI, it will log to stderr by default. For mod_php, it will log to the httpd error log as determined by the the httpd configuration. Why/how would you change either of those things, and how would it help? I think this conversation would be better on the fedora-php-devel-list. By system-wide default I meant a configuration change in php.ini to have a single file to contain all the php errors (rather than splitting it into other files, like the apache logs which on some hosts could be quite a few different files resulting in many places to look rather than one single place to look). I also didn't realize that these were being logged in the apache logs until after I had filed the bug. By enabling error_log, when used on the CLI or mod_php, errors will get logged to the defined log file (i.e. /var/log/httpd/php_errors.log). That doesn't replace stderr for the CLI. It may be an additional location for mod_php; I'm not sure if it prevents logging to the apache log file. The idea is to give users a predictable place to look for errors so that they don't do silly things like enable display_errors (which, lame as it is, resulted in over 120 CVE name assignments for various PHP apps). This is an attempt to find a solution that can be looked at as a default predictable place to find these errors across-the-board. I really can't see how this is appropriate/feasible. You don't want to have a log file which is writable both by any user of the php cli and mod_php, it would by unreliable/insecure by definition, since the cli can be invoked by unprivileged user. Example given, /var/log/httpd is only writable by root. I don't particularly see a problem with the status quo, and absent any concrete proposal on what to change I don't want to leave this open indefinitely... ideas still welcome, of course! No problem; it's been open for a while and whether we provide a more sane default or not, the administrator has the power to do this (and a good admin will do this). I can't think of anything more clever other than perhaps having it log to the apache logs by default, but that's also easily enough done. One idea might just be some additional documentation in php.ini making users (who may not know better) aware of some options. |