Fatal error: Uncaught Swoole\Exception: Swoole\Http\Server can only be used in CLI mode in

If you find it useful, you can help me to point a praise it? Let me help you know


Fatal error: Uncaught Swoole\Exception: Swoole\Http\Server can only be used in CLI mode in /home/wwwroot/default/twj/swoole/server/http_server.php:5 Stack trace: #0 /home/wwwroot/default/twj/swoole/server/http_server.php(5): Swoole\Server->__construct('0.0.0.0', 8811) #1 {main} thrown in /home/wwwroot/default/twj/swoole/server/http_server.php on line 5

In http_server time execution swolle encountered the above error, meaning that we did not use cli mode to access.

We can use this function to see if your current mode

php_sapi_name();

 

Code:

 

 

 

Access the browser:

 

linux system command line to see a cli

 

This time we want to access through a browser, how do?

Virtual domain name and listening port on it, as

I do not have to configure the virtual domain, I IP + port to access to this page through my server

This time we went to see the file monitor, display is cli

 

 

If you find it useful, you can help me to point a praise it? Let me help you know

Released six original articles · won praise 7 · views 113

Guess you like

Origin blog.csdn.net/qq_41672878/article/details/104893433