The PHP fsockopen function stopped working on one of my webservers and I can't get it to work again. Here's the PHP code I'm trying to use:
echo '<br><br>Opening socket... '; flush();
.2', 80, $errno, $errstr, 15);
if(!$fp) die('Socket error.');
echo 'OK<br>'; flush();
fputs($fp,"GET /index.php HTTP/1.0\nHost: www.my.link.pl\nContent-type
while (!feof($fp)) echo fread($fp, 8192);
Every time I run this stript, I get the following result:
Fatal error: Maximum execution time of 90 seconds exceeded in /www/test/fsockopen.php on line 6
I don't know what can be wrong. I can easily access the page I want using Linux shell (wget works without problems), but I keep getting timeouts when I try to use the fsockopen function. I also noticed that fopen('http://www...'
) doesn't work either, in spite of that I have allow_url_fopen turned on.