We have built a vehicle tracking system (VTS) device.I have a PHP script which listens to the client connection.
A connection is established when we connect using the Private IP of an EC2 instance, but when we try to put an external IP or public IP in the php script, then it shows an error.
How can I solve this??
I have launched a Linux virtual machine with Amazon EC2. Then connect to the Linux instance from Windows using putty. There is a php script which listens to incoming connections. When I put the Private IP of EC2 then it gets connected, but when I put the public IP it throws the error "unable to bind ip[99]"
public function __construct($bind_ip,$port)
{
set_time_limit(0);
$this->hooks = array();
$this->config["ip"] = $bind_ip;
$this->config["port"] = $port;
$this->master_socket = socket_create(AF_INET, SOCK_STREAM, 0);
socket_bind($this->master_socket,$this->config["ip"],$this->config["port"]) or die("Issue Binding");
socket_getsockname($this->master_socket,$bind_ip,$port);
socket_listen($this->master_socket);
SocketServer::debug("Listenting for connections on {$bind_ip}:{$port}");
}
We want to get data from the vehicle tracking device. We can set the IP address to that device and put that in the PHP script, but when I run it using the public IP it throws the error "unable to bind ip[99]"