Reply to Re: open_basedir: allowed path not recognized

Your name:

Reply:


Posted by Markus on 06/20/07 14:59

Markus schrieb:
> Hi
>
> My ISP seems to have made a PHP version upgrade - without any change in
> the code, a new error occurs:
>
> PHP Warning: ftp_nlist() [function.ftp-nlist]: open_basedir restriction
> in effect. File(/var/tmp/) is not within the allowed path(s):
> (/data/htdocs/domain.com/:/usr/local/share/pear/:/tmp/:/var/tmp/) in ...
>
> I have found some bugs related to open_basedir and temp directory
> creation, they have all been set to Bogus, as /tmp/ should be added to
> the allowed paths. Others are about trailing slashes that do not match.
>
> But what looks special and disturbing to me in my example: The required
> path does actually match an allowed paths entry:
>
> - File(/var/tmp/)
> - allowed path(s):
> (/data/htdocs/domain.com/:/usr/local/share/pear/:/tmp/:/var/tmp/)

Strange enough: Setting a temporary directory with putenv() does not
change anything, ftp_nlist() still tries to use /var/temp/ as temporary
directory.

putenv('TMPDIR='.$_SERVER['DOCUMENT_ROOT'].'/temp/');
var_dump(getenv('TMPDIR')); // prints the path
$list = ftp_nlist($conn_id, '/');

Resulting message is still:
PHP Warning: ftp_nlist() [function.ftp-nlist]: open_basedir restriction
in effect. File(/var/tmp/) is not within the allowed path(s) ...

I tried to replace ftp_nlist() by something like:

ftp_raw($conn_id, 'PASV');
ftp_raw($conn_id, 'TYPE A');
$liste = ftp_raw($conn_id, 'NLST');
var_dump($liste); exit;

This blocks the system for several minutes, then displays an empty array.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация