Port is down
Posted on 2007-08-01
I am trying from my website host to connect from a flash application to a java server on another machine (my machine).
I can connect locally, but from the website host it is not possible to connect.
I tried the script in php below :
It says server is running but port is down.
Maybe you can try yourself ?
my ip : mathi.hopto.org
port of java program : 5000
It must be available because I activated DMZ on my router.
So I tried to run the script on the web hosting server and locally,
both it says that port 5000 is down ...
really weird because locally I can connect to 5000 java server.
Maybe script not working well or I didn't understand something.
echo (" Testing server...<br>");
$ip="mathi.hopto.org"; /* mettez ici l'adresse que vous voulez comme ip à tester*/
$port="5000"; /* mettez ici le port que vous vouez (ou rien si vous voulez juste pinguer..)*/
$ping_check=exec ('/bin/ping -c2 -q -w2 '.$ip.' | grep transmitted | cut -f3 -d"," | cut -f1 -d"," | cut -f1 -d"%"');
echo ("your server $ip is currently up :)<br><br>");
echo (" your server $ip is currently down :(<br><br>");
if ($port && $ping_check==0)
echo (" Testing port...<br>");
$portcheck=exec('/usr/bin/nmap -p '.$port.' --host_timeout=2500 '.$ip.'| grep '.$port.'/tcp | cut -f1 -d"/"');
echo ( "port $port is open on $ip");
echo ( "port $port is down on $ip");