服务器搭建swoft环境

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/happy_teemo/article/details/81903536

lump安装

wget http://soft.vpser.net/lnmp/lnmp1.5.tar.gz -cO lnmp1.5.tar.gz && tar zxf lnmp1.5.tar.gz && cd lnmp1.5 && ./install.sh lnmp

MySQL和PHP选最高版本,其他default就好了

redis安装:
进入lnmp解压后的目录,执行:./addons.sh install redis

编译安装hiredis

使用Redis客户端,需要安装hiredis库。下载hiredis源码后,执行

make -j
sudo make install
sudo ldconfig

swoole安装

wget [https://github.com/swoole/swoole-src/archive/v4.0.4.tar.gz](https://github.com/swoole/swoole-src/archive/v4.0.4.tar.gz)

#解压: 
tar -zxvf v4.0.4.tar.gz

phpize
./configure --enable-async-mysql --enable-async-redis --with-php-config=/usr/local/php/bin/php-config
#这里注意选择自己的php-config路径
make  #如果没装make百度了装一下
make install

#php.ini 里面添加 extension=swoole.so
vim /usr/local/php/etc/php.ini
#小技巧:按一下esc,:/extension=   搜索这个可以很快找到。
lnmp restart #重启下
#服务器IP/phpinfo.php  可以查看是够安装好了

虚拟站点

lnmp vhost add
#详细教程:https://lnmp.org/faq/lnmp-vhost-add-howto.html
#Nginx主配置(默认虚拟主机)文件:/usr/local/nginx/conf/nginx.conf
#添加的虚拟主机配置文件:/usr/local/nginx/conf/vhost/域名.conf

安装swoft

git clone https://github.com/swoft-cloud/swoft
cd swoft
composer install --no-dev # 不安装 dev 依赖会更快一些
cp .env.example .env
vim .env # 根据需要调整启动参数

猜你喜欢

转载自blog.csdn.net/happy_teemo/article/details/81903536