[wp-trac] [WordPress Trac] #29680: Wordpress 4.0 setup stops on start - PHP open_basedir errors are outputted

WordPress Trac noreply at wordpress.org
Mon Sep 15 13:28:04 UTC 2014


#29680: Wordpress 4.0 setup stops on start - PHP open_basedir errors are outputted
--------------------------+-----------------------------
 Reporter:  mklusak       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  4.0
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Hi, there is one situation, when WP 4.0 setup fails - if there is some
 output before header( 'Location: ' . $path ); line in wp-load.php ... then
 I am stuck at blank page with PHP errors, and no redirect to setup files
 happens.

 For example, my hosting company has some open_basedir restriction. My
 hosting "space" directory is for example /data/www/. For every domain is
 generated its own subfolder, like /data/www/mydomain.com,
 /data/www/myanotherdomain.com text. Wordpress files are located in these
 subfolders, and PHP scripts allowed paths are restricted only to this
 subfolders.

 And there is problem: in wp-load.php from line 27 to 32 script tries to
 check:

 {{{
 if ( file_exists( ABSPATH . 'wp-config.php') ) {
 // checks /data/www/mydomain.com/wp-config.php ... it does not exist now

 } elseif ( file_exists( dirname(ABSPATH) . '/wp-config.php' ) && .... ) )
 {
 // checks /data/www/wp-config.php ... it does not exist now, BUT this path
 // is not within alowed paths ... and PHP error is outputted.

 }}}

 And when PHP error is outputed to the browser, then folowing header()
 location redirect fails, and another PHP error is outputted. And setup
 stops.


 {{{
 Warning: file_exists() [function.file-exists]: open_basedir restriction in
 effect. File(.../data/www/wp-config.php) is not within the allowed
 path(s): (.../data/www/mydomain.com:/tmp/uploads) in
 .../data/www/mydomain.com/wp-load.php on line 31

 Warning: Cannot modify header information - headers already sent by
 (output started at .../data/www/mydomain.com/wp-load.php:31) in
 .../data/www/mydomain.com/wp-load.php on line 56
 }}}

 Line numbers can be slightly changed as I was analyzing source code.

 This happend with WP 3.9.x too, but there was only error message on top of
 setup information, and everything worked. I know this is related to
 webserver configuration, but maybe there is some solution.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29680>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list