Scott,
Check open_basedir isn't limiting you to opening files just in your web
server directory. You could also use file_exists to see if PHP can see
the file or try fopening a FTP URL.
Alternatively, you can use fsockopen to connect directly to a web
server and read from it. If this doesn't work then your webserver may
not be routing network traffic correctly. If you can get shell access
(telnet / ssh) to it then log in and try pinging some hosts.
Good luck.
Dave
David Hulbert
Web Developer
Bournemouth & Poole College
01202 205983
[log in to unmask]
>>> Scott Sweeting <[log in to unmask]> 26/08/2008 11:37
>>>
Hi all,
Please accept my apologies for cross posting.
For some time now I have been having some problems with the fopen()
function in PHP. I am able to read files within the local file system,
but not over HTTP/HTTPS. The latter produces the error (when using the
"r" flag):
fopen(http://host.domain.tld/index.php) [<a
href='function.fopen'>function.fopen</a>]: failed to open stream: No
such file or directory in /path/to/test/script.php on line 12
(Note: URL and paths have been substituted.)
I read through the PHP 5.x documentation to see if I could diagnose the
problem. It mentioned that the "allow_url_fopen" needs to be switched
on, so I ran phpinfo() to check and it is - it is also set in php.ini
I have tried different URLs and files, including those on different
servers and the same physical server (VHost configs), but they don't
work either. I have also done some searching on Google and playing
around with settings, but to no avail.
I am unable to work out why this is happening and have never come
across
this before. Therefore, I was wondering if anyone has come across this
before and/or can advise me on what to do, please?
Any pointers would be gratefully received.
Many thanks,
Scott
--
Scott Sweeting
Web Developer
University of Sunderland
Student and Learning Support
University Library Services
T: +44 (0)191 515 2424
F: +44 (0)191 515 2904
E: [log in to unmask] (Fault logging and support requests only)
W: http://webclinic.sunderland.ac.uk
______________________________________________________________________
This email has been scanned for viruses by the Email Protection Agency
For more information please visit http://www.epagency.net
______________________________________________________________________
***********************************************************************
Confidentiality: This email and its attachments are intended for the
above named only and may be confidential. If they have come to you in
error, you must take no action based on them, nor must you copy or show
them to anyone; please reply to this email and highlight the error.
Security Warning: Please note that this email has been created in the
knowledge that Internet email is not a 100% secure communications medium.
We advise that you understand and accept this lack of security when
emailing us.
Viruses: Although we have taken steps to ensure that this email and
attachments are free from any virus, we advise that in keeping with
good computing practice the recipient should ensure they are actually
virus free.
|