473,406 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

open_basedir: allowed path not recognized

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/)

So, what could I be missing? Both temporary directory and open_basedir
seem to be properly set. Could this be a disturbing between the PHP and
FTP users, which have different base directories? Or is it related to
the trailing slash problem?

Does anybody know a way how to work around this? I am grateful for any hint!

Markus
Jun 20 '07 #1
1 4632
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.
Jun 20 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Achim Domma | last post by:
Hi, on a virtual host, I get the following warning: Warning: is_file() : open_basedir restriction in effect. File(/usr/local/httpd/htdocs/kunden/web46/html/images/1041.jpg) is not within the...
1
by: Felix Natter | last post by:
hi, I read the section about open_basedir in the safe_mode documentation (http://de3.php.net/features.safe-mode) but this only confirmed my understanding of open_basedir and didn't help...
7
by: Paul | last post by:
Hi Im testing a script to see if it works in different situations and open_basedir is one of them. However if i turn it On all i get is errors Warning: Unknown(): open_basedir restriction in...
0
by: jeff.battle | last post by:
I'm trying to get PEAR DB to work on my machine at serverbeach but I'm getting the following error: Warning: main(): open_basedir restriction in effect. File(/usr/share/pear/DB.php) is not...
0
by: erwinschrijver | last post by:
On a previous installed server my site which uses several PEAR-packages worked fine. Now it's transfered to a new server. (Both servers installed with Windows 2003 / IIS 6, on the previous server...
2
by: sreniaw | last post by:
Hello, I use php 5.1.4 with apache 2.2.2 on Solaris 10. The problem is that I can't configure open_basedir because I always get warming message: Warning: readfile() : open_basedir restriction...
1
by: janvdberg | last post by:
Hi, up until now I have used PHP4 as an Apache module which works lovely. I used to have the following line per VHost for a userdir: php_admin_value open_basedir /var/www/user/ This allowed...
1
by: lawrence k | last post by:
What is this about? If I ssh to my server and look at php.ini I see this: ; open_basedir, if set, limits all file operations to the defined directory ; and below. This directive makes most...
6
by: lawrence k | last post by:
If I ssh to my server and look at the php.ini file, it apears that open_basedir is off: ; open_basedir, if set, limits all file operations to the defined directory ; and below. This directive...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.