Opened 5 years ago
Closed 4 years ago
#5771 closed defect (bug) (fixed)
error_log in wp-db.php and install failures
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 2.9 |
| Component: | Warnings/Notices | Version: | 2.3.2 |
| Severity: | normal | Keywords: | |
| 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)
comment:4
tenpura
— 5 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.
comment:5
follow-up:
↓ 6
DD32
— 5 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..
comment:6
in reply to:
↑ 5
tenpura
— 5 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.
comment:7
DD32
— 5 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?
comment:9
tenpura
— 5 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?
comment:10
ryan
— 5 years ago
comment:11
ryan
— 5 years ago
That change should prevent the error message from the "is installed" check. That will at least get us past that point.
comment:12
ryan
— 5 years ago
comment:13
ryan
— 5 years ago
comment:14
ryan
— 5 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().
comment:15
ryan
— 5 years ago
comment:16
ryan
— 5 years ago
comment:17
tenpura
— 5 years ago
I got the latest feedback from the tester. The installation was successful with the new fixes.
comment:18
Otto42
— 5 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?
comment:19
Denis-de-Bernardy
— 4 years ago
- Component changed from General to Warnings/Notices
still current?
comment:20
ryan
— 4 years ago
- Resolution set to fixed
- Status changed from reopened to closed
Looks like is_writable is silenced. Closing.
We can silence with "@".