473,508 Members | 2,226 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

open_basedir error

This is the open_basedir restriction of my site:

php_admin_value open_basedir /tmp/:/home/site/

All my PHP files are under /home/site/htdocs. However, I get lots of errors
like:

Warning: open_basedir restriction in effect. File is in wrong directory in
/home/site/.......

I'm 100% sure it's related to open_basedir because disabling it solves the
problem. The funniest thing is:

# Excerpt from /home/site/htdocs/lib/inc/foo.php
include_once('file.inc.php'); # Error unless no open_basedir
include_once('/home/site/htdocs/lib/inc/file.inc.php'); # Works fine

I'm including exactly the same file in the same location so paths are
correct! I added "." to open_basedir but didn't work.

Why???

Thank you in advance,

--
-- Álvaro G. Vicario - Burgos, Spain
-- Questions sent to my mailbox will be billed ;-)
--
Jul 17 '05 #1
3 4617
Alvaro G Vicario wrote:
This is the open_basedir restriction of my site:

php_admin_value open_basedir /tmp/:/home/site/

Is your open_basedir /home/site ot /tmp/:home/site ???
The first would be logical to me, the second I don't understand.
I have specified my open_base_dir in my php.ini as /base/ (part of a
chrooted environment).
Works without a hassle.

Pjotr
Jul 17 '05 #2
*** Pjotr Wedersteers wrote/escribió (Wed, 1 Sep 2004 16:02:37 +0200):
Is your open_basedir /home/site ot /tmp/:home/site ???
The first would be logical to me, the second I don't understand.
I have specified my open_base_dir in my php.ini as /base/ (part of a
chrooted environment).


It's /tmp/:home/site. I don't want users to complain when they're using
scripts that rely on system's default temporary directory.
--
-- Álvaro G. Vicario - Burgos, Spain
-- Questions sent to my mailbox will be billed ;-)
--
Jul 17 '05 #3
*** Alvaro G Vicario wrote/escribió (Wed, 1 Sep 2004 13:51:36 +0200):
php_admin_value open_basedir /tmp/:/home/site/

All my PHP files are under /home/site/htdocs. However, I get lots of errors
like:

Warning: open_basedir restriction in effect. File is in wrong directory in
/home/site/.......


It happened that 'include_path' contained /usr/share/pear/. Whatever the
reason, include_once() tried to search for the file there when I provided a
relative path, thus the warning. Weird thin is that it didn't happen *every
time* I used relative paths...

Solution:

/tmp/:/home/site/:/usr/share/pear/

--
-- Álvaro G. Vicario - Burgos, Spain
-- Questions sent to my mailbox will be billed ;-)
--
Jul 17 '05 #4

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

Similar topics

7
20775
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
1406
by: Chris Ritson | last post by:
I am setting open_basedir to include only the DocumentRoot and PHP installation tree in 16 out of 18 VirtualHosts on our (test) apache server. This is running apache 2.0.53 and PHP 5.0.3. If I...
0
2338
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...
1
2730
by: seajay | last post by:
Hello, I've been searching on the internet for some time now and I was not able to find a solution to this problem. under apache httpd.conf file I have the following setting php_admin_value...
0
2470
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
2994
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
1877
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
15033
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...
2
839
by: rdlowrey | last post by:
Okay, I've tried a bunch of things on this one and can't figure it out. The line in my phpinfo: open_basedir /var/www/vhosts/mysite.com/subdomains/intranet/httpdocs:/ tmp no value Why would...
0
7225
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,...
0
7326
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,...
1
7046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7498
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...
0
3194
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...
0
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1557
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
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...

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.