即使端口打开,也不能连接到PHP TCP / IP服务器?
我有一个活的服务器(Ubuntu 14.04,运行一个LAMP堆栈),这工作正常。 最近,我添加了一个使用PHP代码的TCP / IP服务器。 这是我使用的代码。 请注意,IP地址是一个占位符: <?php error_reporting(E_ALL); /* Allow the script to wait for connections. */ set_time_limit(0); /* Activate the implicit exit dump, so we'll see what we're getting * while messages come. */ ob_implicit_flush(); $address = '123.456.789.123'; $port = 1235; if (($sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP)) === false) { echo "socket_create() failed: […]