初次使用hyperf注意事项

发布时间:2021-12-27 12:10:26 阅读:1326次

作为php开发人员,学习一下swoole是有必要的

平时一直用laravel框架,于是选择了hyperf,据说很多用法一样

开始

首先,不把大量的时间花在配置上,于是安装宝塔面板,安装了php7.4

同时安装php扩展Swoole4

接着点击禁用函数

将以下函数删除

putenv

proc_open

pcntl_fork

pcntl_wait

然后执行

composer create-project hyperf/hyperf-skeleton

一路回车

然后

cd hyperf-skeleton
[root@iZbp13ph356ra22ldly01lZ hyperf-skeleton]# php bin/hyperf.php start

以下为运行结果

[DEBUG] Event Hyperf\Framework\Event\BootApplication handled by Hyperf\Config\Listener\RegisterPropertyHandlerListener listener.
[DEBUG] Event Hyperf\Framework\Event\BootApplication handled by Hyperf\ExceptionHandler\Listener\ExceptionHandlerListener listener.
[DEBUG] Event Hyperf\Framework\Event\BootApplication handled by Hyperf\DbConnection\Listener\RegisterConnectionResolverListener listener.
[DEBUG] Event Hyperf\Framework\Event\BeforeMainServerStart handled by Hyperf\Process\Listener\BootProcessListener listener.
[DEBUG] Event Hyperf\Framework\Event\OnManagerStart handled by Hyperf\Server\Listener\InitProcessTitleListener listener.
[INFO] Worker#1 started.
[DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\Server\Listener\AfterWorkerStartListener listener.
[DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\Server\Listener\InitProcessTitleListener listener.
[DEBUG] Event Hyperf\Framework\Event\OnStart handled by Hyperf\Server\Listener\InitProcessTitleListener listener.
[INFO] Worker#0 started.
[INFO] HTTP Server listening at 0.0.0.0:9501
[DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\Server\Listener\AfterWorkerStartListener listener.
[DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\Server\Listener\InitProcessTitleListener listener.

swoole.use_shortname=off添加到php.ini

特别强调,关闭防火墙,放行9501号端口

如有问题,可以QQ搜索群1028468525加入群聊,欢迎一起研究技术

支付宝 微信

有疑问联系站长,请联系QQ:QQ咨询

转载请注明:初次使用hyperf注意事项 出自老鄢博客 | 欢迎分享