Opened 17 years ago
Closed 15 years ago
#5771 closed defect (bug) (fixed)
error_log in wp-db.php and install failures
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 2.9 | Priority: | normal |
Severity: | normal | Version: | 2.3.2 |
Component: | Warnings/Notices | Keywords: | |
Focuses: | Cc: |
Description
Line 163 (at 2.3.3) in wp-includes/wp-db.php causes an installation failure on a number of hosts, where those hosts have turned off error logging.
Though this in not the fault of WordPress, the expedient solution is to comment out line 163 in wp-db.php.
Is there a better solution? Is there a test that can be added to the code so that in the event hosts have disabled error logging, the installation will procede?
Related info:
http://wordpress.org/support/topic/149537
http://wordpress.org/support/topic/149680
http://forums.crystaltech.com/index.php/topic,32891.0.html
http://community.plus.net/forum/index.php/topic,59525.0.html
http://www.php.net/manual/en/function.error-log.php
Attachments (1)
Change History (21)
#4
@
17 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
I got feedback from a user.
http://phpbb.xwd.jp/viewtopic.php?t=1762
The installation has succeeded with 2.3.3 with the error_log line commented out but still failed with an untouched version of latest trunk, so just using "@" to suppress warnings may not solve the problem itself.
#5
follow-up:
↓ 6
@
17 years ago
Silencing errors *should* prevent WP completely dieing, but given the feedback:
Just a thought though, Would using:
if ( ! function_exists('error_log') ){ function error_log($str,$str2){ }}
Make any difference? or does PHP not like that..
#6
in reply to:
↑ 5
@
17 years ago
Silencing errors *should* prevent WP completely dieing
Error control operator won't prevent scripts dieing if the error is fatal.
I am asking the same person to test the patch and will report if I hear the result from him.
#7
@
17 years ago
Error control operator won't prevent scripts dieing if the error is fatal. I am asking the same person to test the patch and will report if I hear the result from him.
When error_log is disabled via disable_functions the error is simply a warning, Which can be silenced via the @ operator, At least in the PHP versions i've used.
Also, while function_exists will return false for disabled functions. I guess its either wrap it in that, or remove the call?
#9
@
17 years ago
I got the result from him. The installation has failed even with 5771.diff patch.
This means his system has error_log() and the problem occurs when error_log() is actually executed.
It could be a PHP platform/version dependent bug?
#11
@
17 years ago
That change should prevent the error message from the "is installed" check. That will at least get us past that point.
#14
@
17 years ago
I'm thinking that if the error_log ini setting specifies a file (rather than 'syslog'), check to see if that file is_writable. If not, don't try to error_log().
#17
@
17 years ago
I got the latest feedback from the tester. The installation was successful with the new fixes.
#18
@
17 years ago
This one never ends... User reports this error message on one server:
Warning: is_writable() [function.is-writable]: open_basedir restriction in effect. File(error_log) is not within the allowed path(s)
http://wordpress.org/support/topic/186399
Add an @ in front of the is_writable call?
We can silence with "@".