PHPSocket.io運行報錯

maxjyp

報錯
PHP Parse error: syntax error, unexpected '?' in /home/jyp/vendor/workerman/phpsocket.io/src/SocketIO.php on line 23

Parse error: syntax error, unexpected '?' in /home/jyp/vendor/workerman/phpsocket.io/src/SocketIO.php on line 23

<?php
require_once __DIR__ . '/vendor/autoload.php';
use Workerman\Worker;
use PHPSocketIO\SocketIO;

// 创建socket.io服务端,监听3120端口
$io = new SocketIO(3120);
// 当有客户端连接时打印一行文字
$io->on('connection', function($socket)use($io){
  echo "new connection coming\n";
});

Worker::runAll();

php sk_test1.php start

381 1 0
1个回答

maxjyp

解决了。PHP切换命令行版本7.0以上就行了

  • 暂无评论
年代过于久远,无法发表回答
×
🔝