I am trying to read a remote document like below:
- Code: Select all
<?php
readfile("some url");
?>
It works perfect if I have the direct internet connection. However, when I use a connection with proxy, the following error message appears:
- Code: Select all
Warning: readfile() [function.readfile]: php_network_getaddresses: gethostbyname failed in...
I set apache like below:
in c:\xampp\apache\conf\httpd.conf
uncommented lines
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_html_module modules/mod_proxy_html.so
in c:\xampp\apache\bin\php.ini
; Default proxy IP address (if required).
pfpro.proxyaddress = 100.99.98.97:8080
restarted the Apache.
But it still doesn't work.
What I did wrong?
Thanks for any advice.