discuz的php7版本
php7的安装
wget http://am1.php.net/get/php-7.0.4.tar.gz/from/this/mirror
tar zvxf php-7.0.4.tar.gz
cd php-7.0.4./configure --prefix=/data/php7 --with-config-file-path=/data/php7/etc --with-icu-dir=/usr --with-xsl --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --enable-mysqlnd --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 --enable-intl --enable-pcntl --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 --enable-fileinfo --enable-opcache --with-xsl
1、出现错误:
Unable to detect ICU prefix or no failed. Please verify ICU install prefix and make sure icu-config works.
解决方法:
yum install -y icu libicu libicu-devel configure参数增加 --with-icu-dir=/usr
2、出现问题:
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
解决方法:
wget http://softlayer.dl.sourceforge.net/sourceforge/mcrypt/libmcrypt-2.5.8.tar.gz
tar -zxvf libmcrypt-2.5.8.tar.gz
cd /usr/local/src/libmcrypt-2.5.8
./configure
make
make install
3问题:
configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
解决:
yum install -y libxslt libxslt-devel libxml2 libxml2-devel configure加上--with-xsl
出问题解决网站:https://teddysun.com/363.html(非广告哈,确实帮我大忙了)
如果make时候出现liconv相关错误,可进行一下操作
vim Makefile 找到 EXTRA_LIBS 增加 -liconv
最后进行编译安装
make && make install
php.ini文件和php-fpm.conf文件生成。
cp php.ini-production /usr/local/php7/etc/php.ini
cd /usr/src/php-7.0.4/sapi/fpm
cp init.d.php-fpm /etc/init.d/php-fpm
chmod +x /etc/init.d/php-fpm
chkconfig --add php-fpm
chkconfig php-fpm on
为了php7性能再次提升,可以参考鸟哥博客http://www.laruence.com/2015/12/04/3086.html
discuz的php7版本,因为博主第一次做开源,所以里面的redme文档没有写。
代码地址:https://code.csdn.net/zzh787272581/dz-yboard-cn/tree/master(代码只能在php7允许,原因在后面有说明)
里面主要修改点:
1、将eval去掉,这里不针对php7去修改,只是博主觉得这个函数在线上服务器不安全;
2、将preg_replace带有/e 修饰符全部替换成preg_replace_callback 函数,将preg_replace里面数组形式替换成preg_replace_callback_array;这里因为用了preg_replace_callback_array,只能在php7下运行。
3、有一些地方写死了mysql的函数,这里将全部替换成mysqli的函数进行书写。
最后贴一张php5.4和php7下面dz首页的ab压测图,机器不好,所以qps不是很好看。
都是用 ab -n 500 -c http://dz.yboard.cn/
php7
C:\Users\Administrator>ab -n 100 -c 100 http://dz.yboard.cn/
This is ApacheBench, Version 2.3 <$Revision: 1604373 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/Benchmarking dz.yboard.cn (be patient).....doneServer Software: nginx
Server Hostname: dz.yboard.cn
Server Port: 80Document Path: /
Document Length: 0 bytesConcurrency Level: 100
Time taken for tests: 0.182 seconds
Complete requests: 100
Failed requests: 0
Non-2xx responses: 100
Total transferred: 19100 bytes
HTML transferred: 0 bytes
Requests per second: 550.36 [#/sec] (mean)
Time per request: 181.700 [ms] (mean)
Time per request: 1.817 [ms] (mean, across all concurrent requests)
Transfer rate: 102.65 [Kbytes/sec] receivedConnection Times (ms)min mean[+/-sd] median max
Connect: 0 1 1.0 1 5
Processing: 11 100 52.8 107 168
Waiting: 3 96 54.5 102 167
Total: 12 102 52.4 109 168Percentage of the requests served within a certain time (ms)50% 10966% 14775% 15380% 15590% 16295% 16598% 16799% 168100% 168 (longest request)
php5.4.45
C:\Users\Administrator>ab -n 100 -c 100 http://dz-php5.yboard.cn/
This is ApacheBench, Version 2.3 <$Revision: 1604373 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/Benchmarking dz-php5.yboard.cn (be patient).....doneServer Software: nginx
Server Hostname: dz-php5.yboard.cn
Server Port: 80Document Path: /
Document Length: 0 bytesConcurrency Level: 100
Time taken for tests: 0.222 seconds
Complete requests: 100
Failed requests: 0
Non-2xx responses: 100
Total transferred: 17700 bytes
HTML transferred: 0 bytes
Requests per second: 450.15 [#/sec] (mean)
Time per request: 222.150 [ms] (mean)
Time per request: 2.221 [ms] (mean, across all concurrent requests)
Transfer rate: 77.81 [Kbytes/sec] receivedConnection Times (ms)min mean[+/-sd] median max
Connect: 0 1 1.4 1 5
Processing: 76 122 16.8 127 145
Waiting: 76 121 16.6 127 144
Total: 77 123 16.2 129 145Percentage of the requests served within a certain time (ms)50% 12966% 13275% 13480% 13590% 14095% 14398% 14599% 145100% 145 (longest request)
总的来说,性能还是有很大提升的。
欢迎各位同学直接拿来测试使用,如果有问题欢迎提出,我会一直维护这个php7版本,可私下联系我QQ:787272581
discuz的php7版本相关推荐
- 2.7.3 ecshop php7.1_ECshop 迁移到 PHP7版本时遇到的兼容性问题
在 PHP7 上安装 ECShop V2.7.3时,报错! Deprecated: Methods with the same name as their class will not be cons ...
- Discuz!教程之Discuz!X2.5版本安装一些插件显示500错误,或页面打不开的问题修复
尽管目前discuz已经升级到X3.4版本了,但是X2.5版本还有很多站长在使用.目前使用X2.5版本的站长面临的一个很头疼的问题就是好多插件不支持了,或者安装插件直接显示500错误, 具体表现为:安 ...
- php 7.2.2bug,Discuz 7.2版本高危漏洞bug修复
使用discuz建站的朋友们应该都知道,discuz现在已经更新到X3.2版本了,功能也和旧版本有了一些区别.小编今天在逛论坛看到一个关于discuz老版本的消息,说的是Discuz! 7.2 系列论 ...
- php7版本搭建sqli labs,CentOS 7 LAMP搭建并且部署sqli-labs
一.lamp简介(摘自百度百科) 1.1.简介 lamp是指一组通常一起使用来运行动态网站或者服务器的自由软件名称首字母缩写: linux,操作系统 apache,网页服务器 mariadb或mysq ...
- Discuz!论坛各版本通用SEO优化设置教程
网址伪静态设置 后台->全局->SEO设置->URL静态化,如下图: 开启各个模块的伪静态之后,可以点击"查看当前的Rewrite规则",根据自己服务器的情况设置 ...
- 淘宝客服务端SDK PHP7版本简单起步教程
问题说明 使用PHP7 SDK没基础的朋友可能找不到autoload.php文件,导致不能正常使用SDK文件. 服务端SDK下载地址 淘宝客服务端php7 SDK下载地址 https://consol ...
- php7版本一句话木马,一句话查找 PHP 木马
一句话查找 PHP 木马 find ./ -name "*.php" |xargs egrep "phpspy|c99sh|milw0rm|eval\(gunerpres ...
- wampserver2.2e-php5.3.13 版本 增加 php7 支持
公司需要升级PHP版本至PHP7,对于用惯了wamp的来说,添加一下PHP扩展应该是很容易的,看我以前的文章(WampServer自己DIY添加apache.php.mysql版本). 不过再配置的当 ...
- 2008php多版本共存,lnmp安装多版本PHP共存的方法详解
通过lnmp安装了PHP7版本,但是发现与程序不兼容,需要降低到7.0以下的版本. 查找lnmp的install.sh文件,一般在/root/lnmp1.5/install.sh 下执行命令 sudo ...
最新文章
- sublime text 安装Package Control
- 初二因式分解奥数竞赛题_八年级数学因式分解专项练习试题.doc
- 【云笔记搭建】Visual Code + Github仓库 + Git
- BZOJ1061: [Noi2008]志愿者招募(线性规划)
- 华为/华三IS-IS多区域配置及其路由优化
- python的文件操作os_​Python:目录和文件的操作模块os.path
- Android-- bionic介绍
- [数论] 快速傅里叶变换FFT
- mod sim tcp配置_ModSim32-ModScan32Modbus调试工具使用及配置说明.pdf
- C++学习(七十一)3Dtiles glTF glb b3dm
- Tomcat解惑 之 CATALINA_HOME与CATALINA_BASE
- 8大成功的网络营销案例 互联网营销案例分析
- 【目标检测论文解读复现NO.20】基于改进Yolov5的地铁隧道附属设施与衬砌表观病害检测方法
- 三元运算 微信小程序_微信小程序 三元运算符 条件语句if和循环语句for(三目运算+hidden)...
- 格式化JSON字符串
- 什么是过拟合、欠拟合现象以及如何缓解?
- Zookeeper启动成功,报错“Error contacting service. It is probably not running”
- xcode 快速生成代码块
- [译]深入ES6之箭头函数
- 易语言微凉模块oracle,穿透框架全智能填表微凉网页填表模块及源码
热门文章
- 小程序自定制从顶部弹出的picker,模拟贝壳找房
- excel白屏未响应_关于Excel联网状态下打开某些xls(xlsx)文件巨慢(白屏,假死) - Microsoft Community...
- Python @装饰器
- 【Python】办公篇-《极客Python之效率革命》(小甲鱼) 笔记一
- 自定义组件使用el-dialog,且内含表单时,表单提交时字段报错undefined
- [待解答]R语言读文件报错“列的数目比列的名字要多”
- matlab 一些函数的用法
- 音频格式的汇总及压缩比较
- 本地缓存之王-Caffeine
- win10运行安卓模拟器蓝屏崩溃