I have a problem in that I have a script that works fine on my local development server, in that it opens 99% of fsock connections without any problems. However when I upload it to my website, only around 15% of the connections are opened successfully. Does anyone have any ideas on what could cause?
Maybe you should set longer timeout for connection? $timeout = 30; //in seconds $fp = fsockopen("www.example.com", 80, $errno, $errstr, $timeout);
After I posted this I just realised that I forgot to check errstr. It was a timeout issue, however the 9 second timrout works fine on my localhost but not on my remote hosting. I think I'll use your suggestion of a longer timeout period. Maybe the issue is that my computer is faster than my hosting, making my hosting timeout and not my local computer?
I tried setting a longer connection timeout but to no avail. This is really bugging me as I can't work out whats wrong. Does anyone know of what server settings would cause it to timeout? I just wish it would all work as if it were on my local server Now it is not connecting at all and will timeout every connection. I think I'll just try some other hosting
I am now convinced it is a firewall issue. I checked the scripts logs and it is only letting connections through on port 80, and even then a few of them are being blocked. If this is the problem and I get a VPS, would I be able to fix it?
Just finished talking to my hosting support, and they are convinced that it is a script problem. This is driving me insane!