swoole在Linux下的安装

swoole环境安装
1.先安装lamp环境:
apt-get install apache2
apt-get install mysql-server​​
3.apt-get install php7.0
2.安装php的扩展:
sudo apt-get install php7.0-bcmath
sudo apt-get install php7.0-bz2
sudo apt-get install php7.0-calendar
sudo apt-get install php7.0-ctype
sudo apt-get install php7.0-curl
sudo apt-get install php7.0-dom
sudo apt-get install php7.0-enchant
sudo apt-get install php7.0-exif
sudo apt-get install php7.0-fileinfo
sudo apt-get install php7.0-ftp
sudo apt-get install php7.0-gd
sudo apt-get install php7.0-gettext
sudo apt-get install php7.0-gmp
sudo apt-get install php7.0-iconv
sudo apt-get install php7.0-intl
sudo apt-get install php7.0-json
sudo apt-get install php7.0-ldap
sudo apt-get install php7.0-mbstring
sudo apt-get install php7.0-mysqli
sudo apt-get install php7.0-mysqlnd
sudo apt-get install php7.0-opcache
sudo apt-get install php7.0-pdo
sudo apt-get install php7.0-phar
sudo apt-get install php7.0-posix
sudo apt-get install php7.0-pspell
sudo apt-get install php7.0-readline
sudo apt-get install php7.0-shmop
sudo apt-get install php7.0-simplexml
sudo apt-get install php7.0-snmp
sudo apt-get install php7.0-soap
sudo apt-get install php7.0-sockets
sudo apt-get install php7.0-sqlite3
sudo apt-get install php7.0-sysvmsg
sudo apt-get install php7.0-sysvsem
sudo apt-get install php7.0-sysvshm
sudo apt-get install php7.0-wddx
sudo apt-get install php7.0-xml
sudo apt-get install php7.0-xsl​​
以下不能一次性全部安装,因为要选y
sudo apt-get install php7.0-recode
sudo apt-get install php7.0-dba
sudo apt-get install php7.0-imap
sudo apt-get install php7.0-interbase
sudo apt-get install php7.0-odbc
sudo apt-get install php7.0-pgsql
sudo apt-get install php7.0-tidy
sudo apt-get install php7.0-zip​​
sudo apt-get install build-essential
同时安装php的pecl以备后续安装其他扩展
sudo apt-get install php-pear​​
参考:http://blog.csdn.net/koastal/article/details/52850416
3.安装composer
apt-get install composer​​
2.同时设置中国源:
composer config -g repo.packagist composer https://packagist.phpcomposer.com​​
3.使用composer install的时候:
1、首先更新composer
执行composer global require "fxp/composer-asset-plugin:~1.4.0"
2、再进行更新
下面这个过程需要从github获取一个Token
4.安装git
apt-get install git​​
设置:
git config --global user.name "xiayiyong"
git config --global user.email xiayiyong@example.com​​
5.安装swoole通过pecl安装
pecl install swoole-1.8.4
6.安装memcache、redis的服务器
sudo apt-get install memcached
apt-get install redis-server​​
7.安装谷歌的PB服务器
sudo apt-get install protobuf-complier​​
使用命令:protoc --version查看是否安装成功
8.下载并安装php的protocbuff、redis、memcach扩展(或者通过pecl安装)
pecl install protobuf
pecl install protocolbuffers
https://github.com/chobie/php-protocolbuffers​​
#安装protoc扩展
git clone https://github.com/allegro/php-protobuf.git php-protobuf
cd php-protobuf/
phpize
make
make install
找到php.in,加入这行代码:extension=/usr/lib64/php/modules/protobuf.so
重启服务器,使用phpinfo()查看是否已经安装拓展
pecl install memcach
pecl install redis
注意:通过pecl安装的扩展,必须要修改php.ini的配置文件extension=xxxx.so​​
或者在php的安装目录/etc/php/7.0/mods-available/下面 新建.ini文件,同时去上级/etc/php
/7.0/cli/conf.d 和 /etc/php/7.0/apache/conf.d目录下建立软链接
swoole.ini -> /etc/php/7.0/mods-available/swoole.ini
8.所有安装完毕以后,重启

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值