Opened 17 years ago
Closed 16 years ago
#7640 closed defect (bug) (fixed)
Upgrade has warnings when open_basedir is in effect
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 2.7 | Priority: | lowest |
Severity: | minor | Version: | 2.7 |
Component: | Upgrade/Install | Keywords: | needs-patch |
Focuses: | Cc: |
Description
With open_basedir set in PHP to not include where the PHP error log is stored, the database upgrade process shows two PHP warnings (in red with full stack traces - not user friendly at all):
---8<-----
( ! ) Warning: is_writable() [function.is-writable]: open_basedir restriction in effect. File(/var/log/httpd/php-errors_log) is not within the allowed path(s): (/usr/lib/pear:/usr/share/pear/:/usr/share/php-adodb/:/usr/share/php-jaffa/:/var/www:/var/tmp/:/tmp:/vhosts/coil/geek/public_html) in /vhosts/coil/geek/public_html/wp/wp-includes/wp-db.php on line 500
Call Stack
# Time Function Location
1 0.0020 {main}() /vhosts/coil/geek/public_html/wp/wp-admin/upgrade.php:0
2 0.9184 wp_upgrade() /vhosts/coil/geek/public_html/wp/wp-admin/upgrade.php:68
3 0.9213 make_db_current_silent() /vhosts/coil/geek/public_html/wp/wp-admin/includes/upgrade.php:149
4 0.9214 dbDelta() /vhosts/coil/geek/public_html/wp/wp-admin/includes/upgrade.php:1109
5 1.0854 wpdb->query() /vhosts/coil/geek/public_html/wp/wp-admin/includes/upgrade.php:1090
6 1.0957 wpdb->print_error() /vhosts/coil/geek/public_html/wp/wp-includes/wp-db.php:616
7 1.0963 is_writable () /vhosts/coil/geek/public_html/wp/wp-includes/wp-db.php:500
( ! ) Warning: is_writable() [function.is-writable]: open_basedir restriction in effect. File(/var/log/httpd/php-errors_log) is not within the allowed path(s): (/usr/lib/pear:/usr/share/pear/:/usr/share/php-adodb/:/usr/share/php-jaffa/:/var/www:/var/tmp/:/tmp:/vhosts/coil/geek/public_html) in /vhosts/coil/geek/public_html/wp/wp-includes/wp-db.php on line 500
Call Stack
# Time Function Location
1 0.0020 {main}() /vhosts/coil/geek/public_html/wp/wp-admin/upgrade.php:0
2 0.9184 wp_upgrade() /vhosts/coil/geek/public_html/wp/wp-admin/upgrade.php:68
3 0.9213 make_db_current_silent() /vhosts/coil/geek/public_html/wp/wp-admin/includes/upgrade.php:149
4 0.9214 dbDelta() /vhosts/coil/geek/public_html/wp/wp-admin/includes/upgrade.php:1109
5 1.0982 wpdb->query() /vhosts/coil/geek/public_html/wp/wp-admin/includes/upgrade.php:1090
6 1.0994 wpdb->print_error() /vhosts/coil/geek/public_html/wp/wp-includes/wp-db.php:616
7 1.0999 is_writable () /vhosts/coil/geek/public_html/wp/wp-includes/wp-db.php:500
---8<-----
The fix should be simple - in wp-includes/wp-db.php, line 500, use the "don't show warnings" syntax in the call to is_writable, changing that line to:
if ( !empty($log_file) && ('syslog' != $log_file) && !@is_writable($log_file) )
Change History (23)
#2
@
17 years ago
- Summary changed from Upgrade has warnnings when open_basedir is in effect to Upgrade has warnings when open_basedir is in effect
#4
@
17 years ago
is_writable is not particularly reliable, so using it would be a bad move, IMO.
Basically, the error stems from attempting to use the standard PHP error_log function when the host has implemented security such that the default error log is not allowed to be written to.
You could fix this by setting the error_log setting to a writable file (using ini_set). Alternatively, you could just turn off error logging by setting log_errors to false (also using ini_set).
#10
@
17 years ago
- Milestone changed from 2.7 to 2.8
I papered over the problem for now. Moving this ticket to 2.8 for a more thoughtful fix.
#11
@
16 years ago
According to the forum you also hit this with Post edits so it could be a bigger issue. http://wordpress.org/support/topic/224372?replies=2#post-921404
#14
@
16 years ago
According to the forum you also hit this with Post edits so it could be a bigger issue. http://wordpress.org/support/topic/224372?replies=2#post-921404
That appears to be realpath() breaking & returning false.. Bloody nuisance that function is.. I dont think its completely related to this ticket though.
#16
@
16 years ago
Could we just not make WP die with an angry error message (i.e. Get a real host!) when safe_mode and similar restrictions are on? After all, they're getting deprecated... :-)
#17
@
16 years ago
Could we just not make WP die with an angry error message (i.e. Get a real host!) when safe_mode and similar restrictions are on? After all, they're getting deprecated... :-)
Unfortunately thats against WordPress's (and most developers) instincts of supporting users :)
#18
@
16 years ago
- Milestone changed from 2.8 to Future Release
sending this to the oubliette, then...
#21
@
16 years ago
- Milestone changed from 2.9 to Unassigned
- Resolution set to invalid
- Status changed from new to closed
The reporter of this ticket is in error. First of all the messages he is reporting are beautified by xdebug. secondly it's the server configuration that is misleading here. error logging of php is logging into a file where open basedir does not allow it. so this is a configuration issue.
I will close the ticket as invalid now.
#23
@
16 years ago
- Milestone changed from Unassigned to 2.7
- Resolution set to fixed
- Status changed from reopened to closed
Closing as fixed as the is_writable() warnings were silenced. Which as hakre has pointed out, Is about the most one can expect from this due to it being a bad PHP configuration.
I think the cause should be corrected instead of covering up the symptom.