easyswoole 环境与安装

宝塔安装:
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh
swoole 地址:
https://pecl.php.net/package/swoole
https://pecl.php.net/package/swoole
swoole 下载:
wget https://pecl.php.net/get/swoole-4.5.2.tgz
swoole 解压:
tar xvf swoole-4.5.2.tgz
进入解压目录:
cd swoole-4.5.2
生成 configure 文件:
phpize
编译
//第一个 --enable-async-redis使我们需要用到的redis的扩展
//第二个 --with-php-config 是指定了php-config的路径,否则无法编译
./configure --enable-async-redis --with-php-config=/www/server/php/72/bin/php-config
执行:
make && make install

添加swoole扩展,在php.ini文件中:
extension=swoole.so
验证swoole是否安装成功:
php --ri swoole
检验PHP命令有误swoole:
/www/server/php/72/bin/php -m

安装easyswoole
切换阿里云镜像:
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
安装:
composer require easyswoole/easyswoole=3.x
php vendor/easyswoole/easyswoole/bin/easyswoole install
composer dump-autoload

启用框架:php easyswoole start
停止框架:php easyswoole stop force
查看运行效果:http://49.235.87.152:9501
端口放行:
宝塔=》安全

如果端口被占用:
netstat -anp | grep9501
15245/easyswoole easyswoole前面的进程
kill 9 15245

其他问题:
putenv() has been disabled for security reasons in phar
pcntl_signal() has been disabled for your security reasons
PHP禁用函数中删除即可
composer dumpautoload

你可能感兴趣的:(easyseoole,php)