What should I do if I get an error when running swoole?
Solution to the swoole error "Uncaught Error: Class 'swoole_server' not found"
If you are executing the swoole corresponding file, the following error will be reported ,
PHP Fatal error: Uncaught Error: Class 'swoole_server' not found in /mnt/windows/swoole/swoole-src/examples/server/echo.php:2 Stack trace: #0 {main} thrown in /mnt/windows/swoole/swoole-src/examples/server/echo.php on line 2 Fatal error: Uncaught Error: Class 'swoole_server' not found in /mnt/windows/swoole/swoole-src/examples/server/echo.php:2 Stack trace:
The reason why this error occurs is because the php configuration file has not yet added the swoole extension. When the php swoole file is directly executed, this error will be reported.
Recommendation: "swoole tutorial"
can be solved by the following method:
The first step: to php. ini file with swoole extension
vi /data/sort/php/bin/php.ini
Newly added:
extension=swoole
Step 2: Check whether adding swoole extension to php is successful
php -m
You can see more swoole extensions
The third step is to execute the php swoole file again and you will find that it runs normally and no errors are reported
The above is the detailed content of What should I do if I get an error when running swoole?. For more information, please follow other related articles on the PHP Chinese website!