Forum Moderators: coopster
Is producing this:
Warning: php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/html/ test.com/test.php on line 2
Warning: fopen("http://wwww.site.com/index.php", "r") - Bad file descriptor in /var/www/html/test.com/ test.php on line 2
Anyone have the faintest idea what I'm doing wrong?
From the console do a
telnet www.site.com 80. This will connect to site on port 80. Then when the server responds type GET /path/to/doc HTTP/1.0 and press enter twice. Alternatively you could use wget [site.com...] or lynx [site.com...] or any other of a thousand different methods I canīt think of right now.
If you are running a GUI on the server you could use your favorite browser as well. Just make sure that it will access the site the same route the script will. (No proxy in browser while script uses direct access).
HTH Andreas
Alternatively use fopen and then a f* variant to read the file into a variable. Remember, when you fopen you fread, you fwrite, you fclose, etc.
php.net is your friend, Nick ;)
Andreas
I like to use a well known site for testing ;)
Perhaps WebmasterWorld should allow posting of URLs because then you would not edit out the URI you were actually using and then paste it back into your program and get confused about the whole thing.
Anyway, glad you got is sorted out.
Andreas