博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
discuz的php7版本号
阅读量:7187 次
发布时间:2019-06-29

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

php7的安装

wget http://am1.php.net/get/php-7.0.4.tar.gz/from/this/mirrortar zvxf php-7.0.4.tar.gzcd 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.gztar -zxvf libmcrypt-2.5.8.tar.gzcd /usr/local/src/libmcrypt-2.5.8./configure makemake 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.inicd /usr/src/php-7.0.4/sapi/fpmcp init.d.php-fpm /etc/init.d/php-fpmchmod +x /etc/init.d/php-fpmchkconfig --add php-fpmchkconfig 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去改动,仅仅是博主认为这个函数在线上server不安全。

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:        nginxServer Hostname:        dz.yboard.cnServer Port:            80Document Path:          /Document Length:        0 bytesConcurrency Level:      100Time taken for tests:   0.182 secondsComplete requests:      100Failed requests:        0Non-2xx responses:      100Total transferred:      19100 bytesHTML transferred:       0 bytesRequests 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   maxConnect:        0    1   1.0      1       5Processing:    11  100  52.8    107     168Waiting:        3   96  54.5    102     167Total:         12  102  52.4    109     168Percentage of the requests served within a certain time (ms)  50%    109  66%    147  75%    153  80%    155  90%    162  95%    165  98%    167  99%    168 100%    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:        nginxServer Hostname:        dz-php5.yboard.cnServer Port:            80Document Path:          /Document Length:        0 bytesConcurrency Level:      100Time taken for tests:   0.222 secondsComplete requests:      100Failed requests:        0Non-2xx responses:      100Total transferred:      17700 bytesHTML transferred:       0 bytesRequests 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   maxConnect:        0    1   1.4      1       5Processing:    76  122  16.8    127     145Waiting:       76  121  16.6    127     144Total:         77  123  16.2    129     145Percentage of the requests served within a certain time (ms)  50%    129  66%    132  75%    134  80%    135  90%    140  95%    143  98%    145  99%    145 100%    145 (longest request)
总的来说,性能还是有非常大提升的。

欢迎各位同学直接拿来測试使用。假设有问题欢迎提出,我会一直维护这个php7版本号,可私下联系我QQ:787272581

转载地址:http://rzykm.baihongyu.com/

你可能感兴趣的文章
java图像裁切
查看>>
Django 1.8扩展/自定义User
查看>>
使用apache daemon让java程序在unix系统上以服务方式运行
查看>>
WampServer 3.1.0 所需VC运行库下载及安装说明
查看>>
ThinkPHP 模板魔术常量
查看>>
添加非浮动的清楚元素围住浮动元素
查看>>
CentOS挂载NTFS盘符问题
查看>>
文档里组件中的methods方法调用
查看>>
Play 2.0 用户指南 - 异步HTTP编程 --针对Scala开发者
查看>>
Swift 2.0 异常处理
查看>>
Java学习之Xml系列二:xml按条件查询、xml递归遍历所有元素和属性
查看>>
Tomcat7 redis session共享
查看>>
用逻辑运算符实现三目运算符
查看>>
php的openssl_private_encrypt的python实现
查看>>
JDK8新特性(3):Stream API补充介绍
查看>>
php连接状态测试(运行中 关闭浏览器)
查看>>
整合springMVC,Mybatis的Maven项目框架
查看>>
Keras 线性回归
查看>>
Oracle优化查询改写(第二章-给查询结果排序)
查看>>
PHP实现排列组合
查看>>