Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

open_basedir restriction in effect - I'm confused!

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

open_basedir restriction in effect - I'm confused!

Postby ChrisSkidmore » Mon Apr 07, 2003 1:04 pm

Hi
I've been looking for a solution to this problem but only found similar problems and no solution (certainly not one I understand as a solution anyway!!)
This script I'm running is in the dir called admin. and the line is a simple - include "/inc/connectdb.php"

This is my error message:

open_basedir restriction in effect. File is in wrong directory in /path_to_base_dir/admin/inc/connectdb.php

open_basedir from phpinfo() is set exactly as path in the error message.

"safe mode" is set to on but I am trying to run a script within my "bit" of the server - why can't I

any suggestions welcome

Chris
ChrisSkidmore
New php-forum User
New php-forum User
 
Posts: 19
Joined: Sun Aug 18, 2002 4:02 am
Location: Germany

probably just a hack ...

Postby pecoes » Mon Apr 07, 2003 11:29 pm

Hi there

I'm having exactly the same problem and I'm looking for an answer myself, but for the time being - here's a work-around: Run your scripts via cgi, instead of mod_php.

Create an .htaccess file in the root folder (of your site) and put the line

AddType php-cgi php

into it.

That should disable the open_basedir restriction (instead of adjusting it). As I said, it's a just a work-around, not a solution.

Please contact me, if you find something better !!! I have a nagging suspicion this might be a PHP-bug ...

Regards, Pecoes
pecoes
New php-forum User
New php-forum User
 
Posts: 4
Joined: Mon Apr 07, 2003 11:17 pm

Postby ChrisSkidmore » Tue Apr 08, 2003 1:43 am

Thanks for the responce - at least there is some comfort in knowing I'm not alone!!!

If the CGI root is the only way I'll have to start at the beginning 'cos I ain't got a clue!!!

I do know however that I don't have .htaccess access!!!
ChrisSkidmore
New php-forum User
New php-forum User
 
Posts: 19
Joined: Sun Aug 18, 2002 4:02 am
Location: Germany

Postby ChrisSkidmore » Tue Apr 08, 2003 6:25 am

Hi pecoes
well I just came up with this - not my solution unfortunately - I don't understand why but it did make the difference!!!! I'm tempted to think my ISP who I'd also written to has fixed something.

Let me know if it works

"Are those includes outside of your www-site? If not, then this should work:

include($_SERVER['DOCUMENT_ROOT'].'/your/local/root/file.php');
ChrisSkidmore
New php-forum User
New php-forum User
 
Posts: 19
Joined: Sun Aug 18, 2002 4:02 am
Location: Germany

Postby pecoes » Tue Apr 08, 2003 8:21 am

well actually my problem is just that:
I cannot open the contents of $_SERVER['DOCUMENT_ROOT'] ...
pecoes
New php-forum User
New php-forum User
 
Posts: 4
Joined: Mon Apr 07, 2003 11:17 pm


Return to PHP coding => General

Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot] and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.