I am trying to create a tcp server on an ec2 machine with ubuntu platform. While php is running fine from the index.php file, the code returns false at following command:
socket_create(AF_NET,SOCK_STREAM,SQL_TCP);
Although it returns false, socket_last_error() returns 0. I checked output of phpinfo(), and the table shows sockets as enabled. I verified the security group settings from the aws console. It allows ssh and http traffic.
Please suggest what I might have missed in the configurations of the machine.
Thanks in advance.