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.youkuaiyun.com/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.所有安装完毕以后,重启
swoole在Linux下的安装
最新推荐文章于 2024-07-16 14:02:09 发布