Posted by Andy Hassall on 09/08/07 13:36
On Sat, 08 Sep 2007 01:46:20 GMT, Brian <dkkim@bigpond.net.au> wrote:
>$myfile = file('http://google.com');
>I got an error: failed to open stream: Permission denied.
>
>The above script works on my windows pc, but does not work on Linux
>(Fedora 5, php v5.1.2). I found there was no difference between windows
>php.ini and linux php.ini. But it does not work on the Linux web
>browser. I also tested with fopen and fsockopen, but did not work.
>allow_url_fopen was set to On.
>
>I did some other tests:
>1. % php -f /var/www/index.html // works on the linux command line
> // each of the following three lines was tested in the above script.
>2. file('/var/www/index.html'); // this works on the Linux web browser.
>3. file('http://localhost/index.html'); // failed to open stream:
>permission denied.
>4. file('http://google.com'); // failed to open stream: permission denied.
>
>Any possibility for firewall (internet works fine) or other
>configuration issues?
Fedora uses SELinux by default doesn't it? It may be restricting what the
Apache worker processes can do under that user ("apache" or "nobody" or
whatever).
See if this helps: http://docs.fedoraproject.org/selinux-faq-fc5/
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
[Back to original message]
|