Issues

ZF-9642: Zend_Cache_Backend_Static attempting to access folders outside of basedir

Issue Type: Bug Created: 2010-04-09T04:16:28.000+0000 Last Updated: 2010-07-20T07:17:26.000+0000 Status: Closed Fix version(s): - 1.10.7 (28/Jul/10)

Reporter: Ashley Kitson (akzincdig) Assignee: Marc Bennewitz (private) (mabe) Tags: - Zend_Cache

Related issues: - ZF-8993

Attachments:

Description

ZF VERSION = '1.11.0dev'

I get following errors in Zend_Cache_Backend_Static whilst implementing page caching {quote} [09-Apr-2010 11:46:18] PHP Warning: is_dir() [<function.is-dir>]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/var/www/vhosts/fairfax.org.uk/httpdocs:/var/www/vhosts/fairfax.org.uk/application:/tmp:/usr/local/ZWare/libv2:/usr/local/Zend/Core/share/pear) in /usr/local/ZWare/libv2/Zend/Cache/Backend/Static.php on line 269 [09-Apr-2010 11:46:18] PHP Warning: mkdir() [<function.mkdir>]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/var/www/vhosts/fairfax.org.uk/httpdocs:/var/www/vhosts/fairfax.org.uk/application:/tmp:/usr/local/ZWare/libv2:/usr/local/Zend/Core/share/pear) in /usr/local/ZWare/libv2/Zend/Cache/Backend/Static.php on line 270 [09-Apr-2010 11:46:18] PHP Warning: is_dir() [<function.is-dir>]: open_basedir restriction in effect. File(/var) is not within the allowed path(s): (/var/www/vhosts/fairfax.org.uk/httpdocs:/var/www/vhosts/fairfax.org.uk/application:/tmp:/usr/local/ZWare/libv2:/usr/local/Zend/Core/share/pear) in /usr/local/ZWare/libv2/Zend/Cache/Backend/Static.php on line 269 [09-Apr-2010 11:46:18] PHP Warning: mkdir() [<function.mkdir>]: open_basedir restriction in effect. File(/var) is not within the allowed path(s): (/var/www/vhosts/fairfax.org.uk/httpdocs:/var/www/vhosts/fairfax.org.uk/application:/tmp:/usr/local/ZWare/libv2:/usr/local/Zend/Core/share/pear) in /usr/local/ZWare/libv2/Zend/Cache/Backend/Static.php on line 270 [09-Apr-2010 11:46:18] PHP Warning: is_dir() [<function.is-dir>]: open_basedir restriction in effect. File(/var/www) is not within the allowed path(s): (/var/www/vhosts/fairfax.org.uk/httpdocs:/var/www/vhosts/fairfax.org.uk/application:/tmp:/usr/local/ZWare/libv2:/usr/local/Zend/Core/share/pear) in /usr/local/ZWare/libv2/Zend/Cache/Backend/Static.php on line 269 [09-Apr-2010 11:46:18] PHP Warning: mkdir() [<function.mkdir>]: open_basedir restriction in effect. File(/var/www) is not within the allowed path(s): (/var/www/vhosts/fairfax.org.uk/httpdocs:/var/www/vhosts/fairfax.org.uk/application:/tmp:/usr/local/ZWare/libv2:/usr/local/Zend/Core/share/pear) in /usr/local/ZWare/libv2/Zend/Cache/Backend/Static.php on line 270 [09-Apr-2010 11:46:18] PHP Warning: is_dir() [<function.is-dir>]: open_basedir restriction in effect. File(/var/www/vhosts) is not within the allowed path(s): (/var/www/vhosts/fairfax.org.uk/httpdocs:/var/www/vhosts/fairfax.org.uk/application:/tmp:/usr/local/ZWare/libv2:/usr/local/Zend/Core/share/pear) in /usr/local/ZWare/libv2/Zend/Cache/Backend/Static.php on line 269 [09-Apr-2010 11:46:18] PHP Warning: mkdir() [<function.mkdir>]: open_basedir restriction in effect. File(/var/www/vhosts) is not within the allowed path(s): (/var/www/vhosts/fairfax.org.uk/httpdocs:/var/www/vhosts/fairfax.org.uk/application:/tmp:/usr/local/ZWare/libv2:/usr/local/Zend/Core/share/pear) in /usr/local/ZWare/libv2/Zend/Cache/Backend/Static.php on line 270 [09-Apr-2010 11:46:18] PHP Warning: is_dir() [<function.is-dir>]: open_basedir restriction in effect. File(/var/www/vhosts/fairfax.org.uk) is not within the allowed path(s): (/var/www/vhosts/fairfax.org.uk/httpdocs:/var/www/vhosts/fairfax.org.uk/application:/tmp:/usr/local/ZWare/libv2:/usr/local/Zend/Core/share/pear) in /usr/local/ZWare/libv2/Zend/Cache/Backend/Static.php on line 269 [09-Apr-2010 11:46:18] PHP Warning: mkdir() [<function.mkdir>]: open_basedir restriction in effect. File(/var/www/vhosts/fairfax.org.uk) is not within the allowed path(s): (/var/www/vhosts/fairfax.org.uk/httpdocs:/var/www/vhosts/fairfax.org.uk/application:/tmp:/usr/local/ZWare/libv2:/usr/local/Zend/Core/share/pear) in /usr/local/ZWare/libv2/Zend/Cache/Backend/Static.php on line 270 {quote}

i.e right up where the path is allowed In this instance, the public_dir is set up as '/var/www/vhosts/fairfax.org.uk/httpdocs/pagecache' for 'Static' backend and open_basedir is set for '/var/www/vhosts/fairfax.org.uk/httpdocs' as you can see in the error messages.

The problem is in the _createDirectoriesFor() method which is trying to create all the way back from root even though it is unlikely that would ever be in an open basedir.

Suggestions: quick fix: suppress errors longer term fix: Check if open_basedir restriction is in effect and then try a match to allowed paths, using a matched one as a starting point for directory creation if found.

Comments

Posted by Marc Bennewitz (private) (mabe) on 2010-07-20T00:48:47.000+0000

fixed in r22644 (trunk) & r22645 (1.10 branch)

-> create directories recursive using third argument of mkdir

Posted by Ramon Henrique Ornelas (ramon) on 2010-07-20T07:17:25.000+0000

Hi Marc Could make tests units?

Thanks advance.

Greetings Ramon

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts