|
Posted by J.O. Aho on 09/15/05 13:31
volantecho@gmail.com wrote:
> Hi all.
>
> I'm having problem when i tried to include file in my php script.
>
> ie : /home/lain/public_html/index.php
>
> at line 3, i require a file outside the public_html
> require_once("/home/lain/lainlib/global.inc.php");
>
> but i receive the error message shown as below :
> Warning: main(/home/lain/lainlib/global.inc.php) [function.main]:
> failed to open stream: Permission denied in
> /home/lain/public_html/index.php on line 3
>
> i wonder it is my apache configuration setting problem.
As long as you can run php on the server, the settings aren't wrong.
> things i'd gone through:
> 1. all related files, folder i 've chmod 755 on them, still failed.
> 2. try to run the index.php in SSH, it works!!
Apache must have the right to read and execute (chmod o+rx)
/home
/home/lain
/home/lain/lainlib
/home/lain/public_html
and the right to read (chmod o+r)
/home/lain/lainlib/global.inc.php
/home/lain/public_html/index.php
> i wonder is it when i run the script on a browser, it doesnt have
> enough permission to 'get' the file outside from public_html.
> it's able to include files inside the public_html folder, while the
> line 2 in index.php do so.
Settings in php may prevent usage of some functions, check your php.ini.
//Aho
Navigation:
[Reply to this message]
|