Hello,
None of my users (including a few of my own sites) have the right to open a connection (fsockopen) to another server.
"Warning: fsockopen(): unable to connect to *** "
Why is this?
Hello,
None of my users (including a few of my own sites) have the right to open a connection (fsockopen) to another server.
"Warning: fsockopen(): unable to connect to *** "
Why is this?
Hi,
This probably is caused by your firewall configuration.You may need to allow both incoming and outgoing access for the ip and/or the port number you wish to connect to.
We had similar issues before and have solved them this way.Hope it helps.
Thanks
Brain Hosting, Inc.
Exceeding Your Expectations
Visit us at
www.brainhosting.com
no, our firewall does not have any rules against this. It allows all outbound traffic, inbound is filtered.Originally Posted by brainx
It has to do something with PHP, just can't figure it out?
Wieger.
Are you able to connect using telnet from the server to the exact same remote server?
With SSH it all goes well.. telnet returns valid information.
It's only when i want to fsockopen() with a script.
Did you check the allow_url_fopen setting in php.ini ?
phpinfo says;Originally Posted by jamesbond
allow_url_fopen On On
So, any options?
From the PHP manual (http://pl2.php.net/manual/en/function.fsockopen.php):
Try specifying the optional paramaters errno and errstr and then print them afterwards. This should give you more specific errors which should aid the troubleshooting process.If the call fails, it will return FALSE and if the optional errno and errstr arguments are present they will be set to indicate the actual system level error that occurred in the system-level connect() call. If the value returned in errno is 0 and the function returned FALSE, it is an indication that the error occurred before the connect() call. This is most likely due to a problem initializing the socket. Note that the errno and errstr arguments will always be passed by reference.
PHP Code:$fp = fsockopen ("example.com/index.html", 80, $errno, $errstr, 30);
if ($fp === false) {
print($errno." : ".$errstr);
}
As i said, permission denied?Originally Posted by webignition
So, again no options..
I suppose if you've exhausted all of the options presented here and you're still unable to resolve the problem, all I could suggest would be:
1. Thoroughly search the forums in case there is a thread on this that you missed
2. Use Google or some other search engine to hunt for solutions
3. Contact your data center for support
4. Hire someone if you're unable to resolve the issue yourself
done all that, nobody seems to know.. but i found someone with the same problem on the forum (also, no sollution?)