Connecting Tech Pros Worldwide Forums | Help | Site Map

Help needed

-D-
Guest
 
Posts: n/a
#1: Sep 6 '08
Hi all php gurus :)

I'm having a problem

following line of php code
include ('head.include.php');

Following config settings
open_basedir /home/webhosting/websites

This is what I get when running echo $_SERVER['SCRIPT_FILENAME'];
/home/webhosting/websites/website.com/www/showpath.php

now the problem is the page dosn't work and the log says
[Sat Sep 06 03:27:09 2008] [error] [client 61.49.255.135] PHP
Warning: main() [<a href='function.main'>function.main</a>]:
open_basedir restriction in effect. File(/head.include.php) is not
within the allowed path(s): (/home/webhosting/websites) in /home/
webhosting/websites/website.com/www/includes/sessions.php on line 2


What is wrong here? should the open_basedir be set to different value?
I thought it included all files/directories below the tree?

PHP Version 5.0.4

Thanks for any ideas as to what's causing it.

Jerry Stuckle
Guest
 
Posts: n/a
#2: Sep 6 '08

re: Help needed


-D- wrote:
Quote:
Hi all php gurus :)
>
I'm having a problem
>
following line of php code
include ('head.include.php');
>
Following config settings
open_basedir /home/webhosting/websites
>
This is what I get when running echo $_SERVER['SCRIPT_FILENAME'];
/home/webhosting/websites/website.com/www/showpath.php
>
now the problem is the page dosn't work and the log says
[Sat Sep 06 03:27:09 2008] [error] [client 61.49.255.135] PHP
Warning: main() [<a href='function.main'>function.main</a>]:
open_basedir restriction in effect. File(/head.include.php) is not
within the allowed path(s): (/home/webhosting/websites) in /home/
webhosting/websites/website.com/www/includes/sessions.php on line 2
>
>
What is wrong here? should the open_basedir be set to different value?
I thought it included all files/directories below the tree?
>
PHP Version 5.0.4
>
Thanks for any ideas as to what's causing it.
>
Yes, open_basedir allows access to the specified directory and all files
below.

But why would it be looking for /head.include.php? This isn't in the
allowed path. What do you have for include_path? Or did you maybe have
('/head.include.php')?

Finally, look at phpinfo() to see what your settings really are. They
may not be what you think (i.e. looking at the wrong php.ini file).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

-D-
Guest
 
Posts: n/a
#3: Sep 6 '08

re: Help needed


On 6 Sep, 10:36, Jerry Stuckle <jstuck...@attglobal.netwrote:
Quote:
-D- wrote:
Quote:
Hi all php gurus :)
>
Quote:
I'm having a problem
>
Quote:
following line of php code
include ('head.include.php');
>
Quote:
Following config settings
open_basedir /home/webhosting/websites
>
Quote:
This is what I get when running echo $_SERVER['SCRIPT_FILENAME'];
/home/webhosting/websites/website.com/www/showpath.php
>
Quote:
now the problem is the page dosn't work and the log says
[Sat Sep 06 03:27:09 2008] [error] [client 61.49.255.135] PHP
Warning: *main() [<a href='function.main'>function.main</a>]:
open_basedir restriction in effect. File(/head.include.php) is not
within the allowed path(s): (/home/webhosting/websites) in /home/
webhosting/websites/website.com/www/includes/sessions.php on line 2
>
Quote:
What is wrong here? should the open_basedir be set to different value?
I thought it included all files/directories below the tree?
>
Quote:
PHP Version 5.0.4
>
Quote:
Thanks for any ideas as to what's causing it.
>
Yes, open_basedir allows access to the specified directory and all files
below.
>
But why would it be looking for /head.include.php? *This isn't in the
allowed path. *What do you have for include_path? *Or did you maybe have
('/head.include.php')?
>
Finally, look at phpinfo() to see what your settings really are. *They
may not be what you think (i.e. looking at the wrong php.ini file).
>
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================- Dölj citerad text -
>
- Visa citerad text -
Well, the information posten in previous post is from phpinfo and
directly from the code, so as you can see the include command is just
'head.include.php' and no specific path. I guess the people who
developed the system I'm installing didn't consider open_basedir to be
set to anything else than none..

Turning it off should solve the problem I guess
Jerry Stuckle
Guest
 
Posts: n/a
#4: Sep 6 '08

re: Help needed


-D- wrote:
Quote:
On 6 Sep, 10:36, Jerry Stuckle <jstuck...@attglobal.netwrote:
Quote:
>-D- wrote:
Quote:
>>Hi all php gurus :)
>>I'm having a problem
>>following line of php code
>>include ('head.include.php');
>>Following config settings
>>open_basedir /home/webhosting/websites
>>This is what I get when running echo $_SERVER['SCRIPT_FILENAME'];
>>/home/webhosting/websites/website.com/www/showpath.php
>>now the problem is the page dosn't work and the log says
>>[Sat Sep 06 03:27:09 2008] [error] [client 61.49.255.135] PHP
>>Warning: main() [<a href='function.main'>function.main</a>]:
>>open_basedir restriction in effect. File(/head.include.php) is not
>>within the allowed path(s): (/home/webhosting/websites) in /home/
>>webhosting/websites/website.com/www/includes/sessions.php on line 2
>>What is wrong here? should the open_basedir be set to different value?
>>I thought it included all files/directories below the tree?
>>PHP Version 5.0.4
>>Thanks for any ideas as to what's causing it.
>Yes, open_basedir allows access to the specified directory and all files
>below.
>>
>But why would it be looking for /head.include.php? This isn't in the
>allowed path. What do you have for include_path? Or did you maybe have
>('/head.include.php')?
>>
>Finally, look at phpinfo() to see what your settings really are. They
>may not be what you think (i.e. looking at the wrong php.ini file).
>>
>--
>==================
>Remove the "x" from my email address
>Jerry Stuckle
>JDS Computer Training Corp.
>jstuck...@attglobal.net
>==================- Dölj citerad text -
>>
>- Visa citerad text -
>
Well, the information posten in previous post is from phpinfo and
directly from the code, so as you can see the include command is just
'head.include.php' and no specific path. I guess the people who
developed the system I'm installing didn't consider open_basedir to be
set to anything else than none..
>
Turning it off should solve the problem I guess
>
Yes, that should fix the problem. However, I still don't understand why
it should be failing.

I believe what you're saying - I asked because too many people retype
code into a message instead of copy/paste, and change the code in the
meantime. Also, too many people get their settings by looking at the
php.ini file - but they're looking at the wrong file.


But there is some disconnect here, because as you describe it, the
include should be working fine.

Are you sure there isn't another include that might be the failing one?

Also, in your php.ini file, set display_errors=on and
error_reporting=E_ALL. This will put your error messages in the window
so you can see exactly what's happening, instead of having to figure it
out from the log.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Closed Thread