473,396 Members | 2,037 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,396 software developers and data experts.

odd basedir() err or

I'm surprised to get an open_basedir error when I'm not only in the
correct folder for web documents, but I'm an extra layer deep. Basedir
is usually there to restrict how high up in the directory structure a
PHP fopen or include statement can reach, yes? The idea is to keep
someone in a hosted environment from launching an attack by including
files, or opening them, that are outside of the web environment? How do
I change the basedir?
Warning: MkDir failed (Permission denied) in
/home/httpd/vhosts/publicdomainsoftware.org/httpdocs/setup/neededFiles/writeAllNeededFolders.php
on line 11

Warning: open_basedir restriction in effect. File is in wrong directory
in
/home/httpd/vhosts/publicdomainsoftware.org/httpdocs/setup/neededFiles/writeAllNeededFolders.php
on line 12

Jul 17 '05 #1
4 1704

lk******@geocities.com wrote:
I'm surprised to get an open_basedir error when I'm not only in the
correct folder for web documents, but I'm an extra layer deep. Basedir is usually there to restrict how high up in the directory structure a
PHP fopen or include statement can reach, yes? The idea is to keep
someone in a hosted environment from launching an attack by including
files, or opening them, that are outside of the web environment? How do I change the basedir?
Warning: MkDir failed (Permission denied) in
/home/httpd/vhosts/publicdomainsoftware.org/httpdocs/setup/neededFiles/writeAllNeededFolders.php on line 11

Warning: open_basedir restriction in effect. File is in wrong directory in
/home/httpd/vhosts/publicdomainsoftware.org/httpdocs/setup/neededFiles/writeAllNeededFolders.php on line 12


I guess I'm looking for the right .htaccess directive to insert the
line

php_admin_value open_basedir none
Do I look to Apache for this, or www.php.net?

Jul 17 '05 #2
I fixed this by using DOCUMENT_ROOT and therefore an absolute address,
rather than a relative one. This is apparently a known bug, you
sometimes get the open_basedir error when using relative paths.

In the end I went:

$root = $GLOBALS["SCRIPT_NAME"];
$root = str_replace("setup.php", "", $root);

The last line was to get the name of the file out of the directory
path. Isn't there another way to get the path, without the file name?

Jul 17 '05 #3
lk******@geocities.com wrote:
I fixed this by using DOCUMENT_ROOT and therefore an absolute address,
rather than a relative one. This is apparently a known bug, you
sometimes get the open_basedir error when using relative paths.

In the end I went:

$root = $GLOBALS["SCRIPT_NAME"];
$root = str_replace("setup.php", "", $root);

The last line was to get the name of the file out of the directory
path. Isn't there another way to get the path, without the file name?


Use strrpos to find the last position of "/", then substr it from the
first position to the position returned from strrpos.
Jul 17 '05 #4
On 20 Dec 2004 11:54:15 -0800, lk******@geocities.com wrote:
I fixed this by using DOCUMENT_ROOT and therefore an absolute address,
rather than a relative one. This is apparently a known bug, you
sometimes get the open_basedir error when using relative paths.

In the end I went:

$root = $GLOBALS["SCRIPT_NAME"];
$root = str_replace("setup.php", "", $root);

The last line was to get the name of the file out of the directory
path. Isn't there another way to get the path, without the file name?


http://php.net/manual/en/ref.filesystem.php
http://php.net/dirname

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #5

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

Similar topics

6
by: Juho Saarikko | last post by:
The program attached to this message makes the Python interpreter segfault randomly. I have tried both Python 2.2 which came with Debian Stable, and self-compiled Python 2.3.3 (newest I could find...
5
by: Juho Saarikko | last post by:
I made a Python script which takes Usenet message bodies from a database, decodes uuencoded contents and inserts them as Large Object into a PostGreSQL database. However, it appears that the to...
0
by: Nils Valentin | last post by:
Hello MySQL Fans, This time I am using 4.0.13-max (tar format from www.mysql.com) on Redhat 9. I have an understanding question why would the command SHOW VRAIABLES give me once the real...
0
by: Eric Bisson | last post by:
Hi. I am using the FOP 0.20.5 task in Ant 1.5.1 to transform a .fo file into a PDF. The transformation is correct except for the image file (file not found). The image file is in a directory...
11
by: comp.lang.php | last post by:
function blah($item) { if (!isset($baseDir)) { static $baseDir = ''; $baseDir = $item; print_r("baseDir = $baseDir\n"); } $dirID = opendir($item); while (($fyl = readdir($dirID)) !== false)...
3
by: Simon Brooke | last post by:
As various people will have noticed, I've been having a lot of trouble with XSL lately. Brief history: I wrote myself an XML toolkit back in 2000, and it worked well enough for me, so it's been...
7
by: Dave Kelly | last post by:
There has to be a name for what I want to do and I don't know what words to google for. I have a form here: http://www.texasflyfishers.org/firstpage.htm I want to submit it to the server and...
4
by: aldsaldrin | last post by:
Hi, <project name="Project" default="default.info" basedir="."> How do I know where the basedir is pointed/located? Any help is much appreciated.. Many thanks..
6
by: Hibblejaybob | last post by:
Hi, I've been writing a program in VB 2008. Ater testing a section and it all working fine, I added the next function and i got the {"Value cannot be null.\r\nParameter name: activationContext"}...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.