Posted by Brian on 09/08/07 01:46
Hi
I have a problem in opening url using 'file'.
I searched many other discussion groups and tried suggestions,
but could not resolve this problem.
e.g
<?php
$myfile = file('http://google.com');
foreach ( $myfile as $vals){
print "$vals";
}
?>
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?
Could anyone can help me please?
bk
[Back to original message]
|