hyperf手记

常用命令:

开启:php bin/hyperf.php start

hyperf 启动、重启、停止、文件变化监听命令包 | PHP 技术论坛

强制停止ctrl+c不起作用.

- ctrl+d
ctrl+d可以关闭进程,有时可以代替ctrl+c关停终端

- ctrl+z

有时ctrl+z可以关停终端进程,可以试一下

安装问题:

问题一:Call to undefined function mb_detect_encoding()错误的处理方法

ubuntu php mbstring,如何在Ubuntu中安装PHP `mbstring`扩展?_梧桐叶的梦的博客-CSDN博客

 apt-cache search mbstring

 apt-get install php7.2-mbstring


问题二:hyperf框架如果报错这个 Swoole short function names must be disabled before the server starts, please set swoole.use_shortn,

hyoerf 关闭短别名swoole.use_shortname

请修改当前使用的PHP版本的配置文件php.ini 如果还是不生效,在去修改php-cli.ini 配置文件

问题三:PHP Fatal error: Uncaught Swoole\Exception: failed to listen server port[0.0.0.0:9501], Error: Address al

1 查看我的 swoole 监听端口号 9501

netstat -anp  | grep  9501

2 关掉进行

kill -9 29854

29854 就是我图中的

路由问题

sys.DEBUG : Hyperf\HttpMessage\Exception\NotFoundHttpException:Not Found(0) in /*/hyperf-bm-api/vendor/hyperf/http-server/src/CoreMiddleware.php:173

解决: 路由问题

查看路由注册状态:php bin/hyperf.php  describe:routes

https://zhuanlan.zhihu.com/p/563983666?utm_id=0

猜你喜欢

转载自blog.csdn.net/cxs812760493/article/details/127666572