博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
PHP7.2环境(含swoole、redis、inotify)
阅读量:7099 次
发布时间:2019-06-28

本文共 1872 字,大约阅读时间需要 6 分钟。

hot3.png

安装php7.2.x

从PHP官网下载最新版PHP,然后编译安装

./configure --prefix=/opt/php72 --with-config-file-path=/opt/php72/etc/ --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv=/usr/local/lib --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-gettext --enable-opcache --enable-ftp --with-openssl-dir=/usr/include/openssl

make && make install

 

安装Swoole扩展

pecl安装

/opt/php72/bin/pecl install swoole

 

编译安装

wget http://pecl.php.net/get/swoole-2.1.3.tgz

tar zxvf swoole-2.1.3.tgz

cd swoole-2.1.3

/opt/php72/bin/phpize

./configure --with-php-config=/opt/php72/bin/php-config

make && make install

vim /opt/php72/etc/php.ini

#添加extension = swoole.so

php -m

#查看是否支持swoole

 

安装Redis扩展

wget http://pecl.php.net/get/redis-3.1.6.tgz

tar zxvf redis-3.1.6.tgz

cd redis-3.1.6

/opt/php72/bin/phpize

./configure --with-php-config=/opt/php72/bin/php-config

make && make install

vim /opt/php72/etc/php.ini

#添加extension = redis.so

php -m

#查看是否支持redis

安装inotify(可选)

用于修改代码后自动Reload Worker进程,检查本机inotify是否可用 php --ri inotify

/opt/php72/bin/pecl install inotify

 

安装mcrypt扩展(可选,7.2已弃用mcrypt,需自行安装扩展)

wget http://pecl.php.net/get/mcrypt-1.0.1.tgztar zxvf mcrypt-1.0.1.tgzcd mcrypt-1.0.1/opt/php72/bin/phpize./configure --with-php-config=/opt/php72/bin/php-configmake && sudo make install#添加extension = mcrypt.sophp -m#查看是否支持mcrypt如果出现 configure: error: mcrypt.h not found. Please reinstall libmcrypt. 错误提示安装mcrypt库即可 yum install libmcrypt libmcrypt-devel

 

转载于:https://my.oschina.net/peaksoho/blog/1832269

你可能感兴趣的文章
20165208 2017-2018-2 《Java程序设计》第三周学习总结
查看>>
apache spring @RequiresRoles 不起作用
查看>>
Java基础班学习笔记(6)
查看>>
分享小功能
查看>>
MyEclipse中自定义maven命令(添加maven 命令)
查看>>
ps存jpeg,格式保存的时候为什么选择“基线”
查看>>
c#3.0 新语法 局部方法 Partial Methods 定义说明
查看>>
HTTP+SVN访问速度慢的问题
查看>>
C# 邮件发送方法【webMail方式】
查看>>
order by 指定顺序 mysql
查看>>
leetcode 215. Kth Largest Element in an Array
查看>>
【数据排序】快速排序
查看>>
js中的return,return true,return false小结
查看>>
Rommel - C# 浅谈 接口(Interface)的作用
查看>>
Debian下Apache配置多域名访问
查看>>
关于git的个人开发终端命令行
查看>>
一位前辈写的HTML规范
查看>>
删除字符串第一个byte
查看>>
从字符集发展史看Unicode和UTF-8的区别
查看>>
随笔杂记
查看>>