Re: open_basedir
| From: | David Robley | Date: | Sat, 20 May 2006 09:47:25 +0000 |
| Subject: | Re: open_basedir | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-236550@lists.php.net to get a copy of this message | ||
Nanu Kalmanovitz wrote:
> Hi!
>
> Using Apache 2, MySQL ver. 4.0.15a, PHP 4.2.3 (NW6.5 sp1 - Netware \
> Novell ).
>
> I'm developing PHP files with Dreamweaver8 (Adobe-Macromedia).
>
> Trying to view a file (quote_insert.php) in a browser, it displays at:
>
>
>
> http://www.kalmanovitz.co.il/DW8_PHP_MySQL_tutorial/admin/quote_insert.php
>
>
> the following warning \ error:
>
> Warning: open_basedir restriction in effect. File is in wrong directory
> in Applic:/HTDocs/DW8_PHP/admin/quote_insert.php on line 1
>
> Fatal error: Failed opening required '../Connections/seasonAdmin.php'
> (include_path='.;sys:/php/includes') in
> Applic:/HTDocs/DW8_PHP/admin/quote_insert.php on line 1
>
> while line 1 is:
>
> <?php require_once('../Connections/seasonAdmin.php'); ?>
>
>
> If I'm changing the line 1 to:
>
> <?php require_once('Connections/seasonAdmin.php'); ?>
>
> without the ../ characters and copy the quote_insert.php file to
> DW8_PHP folder it works OK.
>
> How can I solved the problem without removing the ../ and moving the
> file?
> I changed the PHP file to begin with the following code (added paths
> to every directory \ folder that is involved):.
>
> Now the PHP file to begin with the following code:
>
> <?php
> echo nl2br("Original include path:\n");
> echo ini_get('include_path').nl2br("\n\n");
>
ini_set('include_path',ini_get('include_path').';Applic:/HTDocs/DW8_PHP/admin;Applic:/HTDocs/DW8_PHP/Connections;Applic:/HTDocs/DW8_PHP/');
>
> echo nl2br("New include path:\n");
> echo ini_get('include_path').nl2br("\n");
>
> require_once('Applic:/HTDocs/DW8_PHP/Connections/seasonAdmin.php');
> ?>
>
> You can see the display at
> http://www.kalmanovitz.co.il/DW8_PHP/admin/quote_insert.php
>
> The displayed warning \ error message says:
> Original include path:
> .;sys:/php/includes
>
> New include path:
>
> .;sys:/php/includes;Applic:/HTDocs/DW8_PHP/admin;Applic:/HTDocs/DW8_PHP/Connections;Applic:/HTDocs/DW8_PHP/
>
>
> Warning: open_basedir restriction in effect. File is in wrong directory
> in Applic:/HTDocs/DW8_PHP/admin/quote_insert.php on line 8
>
> Fatal error: Failed opening required
> 'Applic:/HTDocs/DW8_PHP/Connections/seasonAdmin.php'
>
(include_path='.;sys:/php/includes;Applic:/HTDocs/DW8_PHP/admin;Applic:/HTDocs/DW8_PHP/Connections;Applic:/HTDocs/DW8_PHP/')
> in Applic:/HTDocs/DW8_PHP/admin/quote_insert.php on line 8
>
>
> Can anyone see \ find what is wrong?
You apparrently have a setting activated in your php.ini that restricts
opening files to a certain directory structure. Go to
http://il.php.net/manual/en/features.safe-mode.php
and scroll down til you
get to the section on open_basedir which will tel you what the setting is
about. You can change it in php.ini for global effect, or in httpd.conf for
specific locations
Cheers
--
David Robley
I used to have a handle on life, then it broke.
Today is Setting Orange, the 67th day of Discord in the YOLD 3172.