Page 1 of 1

Include of remote files fails

Posted: Wed Jul 30, 2003 1:05 am
by salto
PHP 4.3.2, Apache 2.0.47, windows XP Pro

PHP includes of remote files give an error on Apache 2.0.47, includes of local files no problem.
The problem with inclusion of remote files was supposedly solved with PHP 4.3.2, but still seems a problem on Apache 2.0.47.

Code: Select all

<?php include('http://www.somedomain.com/');  ?>
gives error
Failed opening 'http://www.somedomain.com/' for inclusion (include_path='.;c:\php4\pear')
(FYI http://www.somedomain.com is in real an existing domain and there is no c:\php4\pear - seems to be a default message)

Is there any setting I should look into? Any ideas/help most welcome!
Thanks for your attention.

...

Posted: Wed Jul 30, 2003 1:23 am
by kettle_drum
Hmmm not sure if this works on windows. Try setting allow_url_fopen to true.

If you have no luck then use fopen.

Posted: Wed Jul 30, 2003 1:51 am
by salto
Thanks, yes allow_url_fopen is true, fopen() does not work, readfile() only works for for example remote plain textfiles, not for http://www.somedomain.com, then I get this warning
php_network_getaddresses: gethostbyname failed
readfile("http://www.somedomain.com/") - Invalid argument
for fopen() I get
Wrong parameter count for fopen()