[wp-trac] [WordPress Trac] #7640: Upgrade has warnnings when open_basedir is in effect

WordPress Trac wp-trac at lists.automattic.com
Fri Aug 29 09:58:10 GMT 2008


#7640: Upgrade has warnnings when open_basedir is in effect
---------------------+------------------------------------------------------
 Reporter:  Oded     |       Owner:  anonymous
     Type:  defect   |      Status:  new      
 Priority:  normal   |   Milestone:  2.6.2    
Component:  General  |     Version:           
 Severity:  minor    |    Keywords:           
---------------------+------------------------------------------------------
 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) )

-- 
Ticket URL: <http://trac.wordpress.org/ticket/7640>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list