linux平台编译安装PHP7并安装Redis扩展与Swoole扩展实例教程

58 篇文章 1 订阅

编译安装PHP7并安装Redis扩展Swoole扩展:

在编译php7的机器上已经有编译安装过php5.3以上的版本,从而依赖库都有了

本php7是编译成fpm-php 使用的,如果是apache那么编译参数应该为

?
1
--with-apxs2= /usr/local/apache/bin/apxs

编译安装php7:

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
wget -c http: //www .php.net /distributions/php-7 .0.0. tar .gz
tar zxvf php-7.0.0. tar .gz
cd php-7.0.0
. /configure \
--prefix= /usr/local/php7 \
--with-config- file -path= /usr/local/php7/etc \
-- enable -fpm \
--with-fpm-user=www \
--with-fpm-group=www \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-iconv- dir \
--with-freetype- dir = /usr/local/freetype \
--with-jpeg- dir -\
-with-png- dir \
--with-zlib \
--with-libxml- dir = /usr \
-- enable -xml \
--disable-rpath \
-- enable -bcmath \
-- enable -shmop \
-- enable -sysvsem \
-- enable -inline-optimization \
--with-curl \
-- enable -mbregex \
-- enable -mbstring \
--with-mcrypt \
-- enable - ftp \
--with-gd \
-- enable -gd-native-ttf \
--with-openssl \
--with-mhash \
-- enable -pcntl \
-- enable -sockets \
--with-xmlrpc \
-- enable -zip \
-- enable -soap \
--with-gettext \
--disable-fileinfo \
-- enable -opcache
make ZEND_EXTRA_LIBS= '-liconv'
make install
cp php.ini-production /usr/local/php7/etc/php .ini
cd ..

编译安装php7的redis扩展支持:

?
1
2
3
4
5
6
7
8
wget -c https: //github .com /phpredis/phpredis/archive/php7 .zip
unzip php7.zip
cd phpredis-php7
/usr/local/php7/bin/phpize
. /configure --with-php-config= /usr/local/php7/bin/php-config
make
make install
cd ..

/usr/local/php7/etc/php.ini 中加入:

?
1
extension=redis.so

编译安装php7的swoole

?
1
2
3
4
5
6
7
8
wget -c https: //github .com /swoole/swoole-src/archive/swoole-1 .7.21-stable. tar .gz
tar zxvf swoole-1.7.21-stable. tar .gz
cd swoole-src-swoole-1.7.21-stable/
/usr/local/php7/bin/phpize
. /configure --with-php-config= /usr/local/php7/bin/php-config
make
make install
cd ..

/usr/local/php7/etc/php.ini 中加入:

?
1
extension=swoole.so
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值