Here is a script in PHP I wrote to check if a remote host and port are open for you to connect. Do not mistake this as an equivalent to ping command because ping uses ICMP and I used TCP using PHP’s famous fsockopen() function, and a small piece of AJAX. You can get the latest source code from my GitHub code share page – https://github.com/ninethsense/code-share/ PHP: JavaScript: