You are here: Re: open_basedir « PHP Programming Language « IT news, forums, messages
Re: open_basedir

Posted by Marcin on 06/26/06 12:40

> Now, you cd to /somedir/subdir and execute the script: all is fine.
> Next, you cd to /somedir and execute the script: it fails. Why?
>
> Because you include the text file relatively to the current working dir
> (cwd), PHP expects the text file to be in /somedir, simular to:
>
> readfile('/somedir/test.txt');
>
> And this is restricted, hence the error message. For this reason, using an
> absolute path works, because this doesn't take the cwd into account.

You are right, but problem isn't in it.
On my home's FreeBSD box evrything works ok, but
on Solaris 10 I have to use absolute path's.
Why do I have to do it ?

> To dynamically determine the absolute path, you could do something like:
> readfile(dirname($_SERVER['PHP_SELF']) .'/test.txt');
Thank you, I will use it :)

--
Marcin Kula

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация