Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi,
I want to send http request to different servers in the same time to save some time.
(I need some information from other sites and if I send the requests one by one it takes a long time).
Since PHP 4.4.2 is running on my server I can't use curl_multi_exec.
I tried the following:
I wrote 1 file for each server in wich I send the request
and I run these files from my "main" file.
I use fscokopen to run these files with a code like this:Code: Select all
$fp = fsockopen ("www.booklook.hu", 80, $errno, $errstr);
if ($fp) {
fputs ($fp, "GET /nameofthefile.php HTTP/1.1\r\nHost: http://www.booklook.hu\r\n\r\n");
}
else{
echo "Error";
}
fclose($fp);So I connect to my own domain with fscokopen.
It has been working for 3 month or so, but when I checked the site last week I found the following error:
Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /USER/booklook/booklook_hu/www/fsockproba.php on line 3
Warning: fsockopen(): unable to connect to http://www.booklook.hu:80 in /USER/booklook/booklook_hu/www/fsockproba.php on line 3
Error
Warning: fclose(): supplied argument is not a valid stream resource in /USER/booklook/booklook_hu/www/fsockproba.php on line 12
I didn't changed anything in the code, maybe the PHP version was changed on the server.
The owner of the server is not really helpful, so i think i have to find a alternative solution.
Is this the best method to run php files on my server?
Do you have any ideas how to solve this problem (how can i send http requests paralelly)?
What causes the error? Some domain misconfiguration?
Thank for your replies
Daniel Karpati
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]