Jump to content

[Solved] fsockopen problem


Sarev0k

Recommended Posts

Hi all!

 

I'm trying to use fsockopen to test if a server i'm running in a remote computer is online. Unfortunately its giving me this error:

 

Warning: fsockopen() [function.fsockopen]: unable to connect to socialite.no-ip.biz:7078 (Connection refused)

 

When i use:

http://www.canyouseeme.org/

 

it says success, so i think my firewall/router is well configured.. any ideas?

 

Thanks!

 

EDIT:

 

code i'm using:

 

$fp = fsockopen ("tcp://82.155.237.242", 51003, $errno, $errstr,40);

if ($fp)

{

echo "success";

}

else{

echo "failure";

}

Link to comment
Share on other sites

The fsockopen function is working fine.

 

http://byrondallas.heliohost.org/php/101/fsocket.php

 

<?php
$fp = fsockopen("www.google.com", 80, $errno, $errstr, 30);
if ($fp == false) {
echo "$errstr ($errno)"; 
} else { 
fputs($fp, "GET / HTTP/1.1\r\n");
fputs($fp, "Host: www.google.com\r\n");
fputs($fp, "Connection: Close\r\n\r\n");
while (!feof($fp)) {
echo fgets($fp, 1024);
} 
fclose($fp); 
} 
?>

 

Link to comment
Share on other sites

I'm running a server at my home PC, and i need the to make available in the site if server is online or offline.

So the ports are closed? Spent an all nighter on this :s

 

Could u open up a port for me? or u can only open a port if it is for all?

 

if u can:

 

domain: aion-pt.heliohost.org

 

i think any high port is good for me, atm i'm using 7078

Link to comment
Share on other sites

" Why not just run the software on your home server on another port?"

 

I was answering your question :s

 

I can use any port.. if it is open.. (except for ports that are reserved of course, like port 80, 21..)

Link to comment
Share on other sites

Wait, why can't you use port 80? Do you have another web server running on your computer?

 

Note that incoming and outgoing ports are not the same.

 

I'm not atm, but sometimes i need to.. is there another open port i can use besides 80?

 

Btw, can we connect the website to a remote mysql (say, at my home too), or is it blocked?

 

Thanks for your time!

Link to comment
Share on other sites

You can connect to remote MySQL - that port isn't blocked.

 

You can try finding some random ports that are open, but I'm not comfortable publicly posting our open incoming TCP ports.

Link to comment
Share on other sites

You can connect to remote MySQL - that port isn't blocked.

 

You can try finding some random ports that are open, but I'm not comfortable publicly posting our open incoming TCP ports.

 

Ok, thanks for the info, i'll try to connect to my mysql database in my home to see if it works.

 

Could you pm me a port then?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...