You need to create an entry file to access Workerman:
Like the PHP application under nginx PHP-FPM, the application in WorkerMan also needs an entry file, entry There is no requirement for the file name, and this entry file is run in PHP Cli mode. Recommended:workerman tutorial
The entry file contains the code related to creating a listening process, such as the following code snippet developed based on Worker
test.php
count = 4; // 接收到浏览器发送的数据时回复hello world给浏览器 $http_worker->onMessage = function($connection, $data) { // 向浏览器发送hello world $connection->send('hello world'); }; Worker::runAll();
The above is the detailed content of How to access workerman. For more information, please follow other related articles on the PHP Chinese website!