hyperf安裝與部署

文檔

https://hyperf.wiki/2.0/#/zh-cn/quick-start/overview

安裝swoole

環境 swoole4.5 + php7.4

yum -y install gcc gcc-c++ autoconf automake
yum -y install zlib zlib-devel openssl openssl-devel pcre pcre-devel
git clone https://gitee.com/swoole/swoole.git
cd swoole
phpize
./configure --with-php-config=/www/server/php/74/bin/php-config(你的php-config路徑)
make && make install

php.ini配置
[swoole4.5]
extension = /www/server/php/74/lib/php/extensions/no-debug-non-zts-20190902/swoole.so(你的php擴展路徑)
swoole.use_shortname = ‘off’

重啓服務
service php-fpm restart

php命令

查看已安裝的依賴 php -m

swoole命令

版本查看 php --ri swoole

拉取程序

composer create-project hyperf/hyperf-skeleton

啓動(9501安全組與防火牆記得開)

php bin/hyperf.php start
訪問 http://XXXXip:9501/

創建模型

sudo php bin/hyperf.php gen:model UserModel

查看進程

netstat -anp | grep 9501

殺死進程

kill 6554

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章