473,659 Members | 2,562 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4647
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_i d, 'PASV');
ftp_raw($conn_i d, 'TYPE A');
$liste = ftp_raw($conn_i d, '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
2741
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 allowed path(s): (/usr/local/httpd/htdocs/kunden/web46/) in /srv/www/htdocs/web46/html/jobholder/userdata.php on line 105
1
2090
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 understand the problem below. I tried to search the net, but couldn't find anything yet. here is my test-case (with php_admin_value open_basedir /home/m2004001):
7
20785
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 effect. File(c:\web\httpdocs\session.php) is not within the allowed path(s): (1) in Unknown on line 0 Warning: Unknown(c:\web\httpdocs\session.php): failed to open stream:
0
2346
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 within the allowed path(s): (/home/httpd/vhosts/adapttosolve.com/httpdocs:/tmp) in... phpinfo() says I have the following open_basedir values set: open_basedir | /home/httpd/vhosts/adapttosolve.com/httpdocs:/tmp | no value
0
2481
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 the PHP version was 5.03, on the new one 5.05) The site gives a open_basedir restriction on this new server. In the php.ini the open_basedir line is commented, but when I run the command phpinfo() there appears to be a local value, which I...
2
3001
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 in effect. File(test.txt) is not within the allowed path(s): (/wwwroot/default) in /wwwroot/default/mk.php on line 3 Warning: readfile(test.txt) : failed to open stream: Not owner in /wwwroot/default/mk.php on line 3
1
6827
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 users to only browse/open their own dir. Also I had a couple of open_basedir entries in my global php.ini file like /tmp for instance. So users could both open /tmp and /var/www/user?
1
1884
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 sense if used in a per- directory ; or per-virtualhost web server configuration file. This directive is ; *NOT* affected by whether Safe Mode is turned On or Off. ;open_basedir =
6
15045
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 makes most sense if used in a per- directory ; or per-virtualhost web server configuration file. This directive is ; *NOT* affected by whether Safe Mode is turned On or Off. ;open_basedir =
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8851
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8751
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8629
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4176
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4338
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.