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去改动,仅仅是博主认为这个函数在线上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).....done Server Software: nginx
Server Hostname: dz.yboard.cn
Server Port: 80 Document Path: /
Document Length: 0 bytes Concurrency 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] received Connection 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 168 Percentage 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).....done Server Software: nginx
Server Hostname: dz-php5.yboard.cn
Server Port: 80 Document Path: /
Document Length: 0 bytes Concurrency 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] received Connection 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 145 Percentage 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

discuz的php7版本号的更多相关文章

  1. discuz对PHP7不支持mysql的兼容性处理

    PHP7 废除了 ”mysql.dll” ,推荐使用 mysqli 或者 pdo_mysql,discuz对原生mysql函数做了如下处理,通过mysqli代替原mysql函数 http://blog ...

  2. 【风雪之隅】写在PHP7发布之际一些话 2015-12-02

    做开源也有4,5年的时间了,从最初的 Yaf,到今天的 PHP7,我参与的项目越来越多,使用我代码的用户也越来越多,明天就要发布的PHP7,绝对是我从事开源以来的一个最重要里程碑,我应该纪念一下今天, ...

  3. discuz!版本号信息改动步骤

    建完网站后,就到了改动discuz! 论坛的步骤了,,将其改动为自己喜欢的样子.是非常有意思的,废话不多说了.以下给大家介绍改动的方法. 1.[改动后台-首页的版权]打开ftp.连接网站,进入到:/f ...

  4. Centos7 在apache+php7环境下 安装 Discuz!X3.4

    拉取Discuz!X3.4代码 git 地址 : https://gitee.com/ComsenzDiscuz/DiscuzX 在/var/www/html 中新建 bbs 文件夹 将git下upl ...

  5. 新环境c7、php7.4、openssl1.1.1g,再discuz里发送邮件总是报ssl连接不上

    Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL r ...

  6. 编译安装基于 fastcgi 模式的多虚拟主机的wordpress和discuz的LAMP架构

    目录 实现CentOS 7 编译安装基于 fastcgi 模式的多虚拟主机的wordpress和discuz的LAMP架构 准备环境: 准备软件版本: 主机名修改用以区分 数据库服务器 实现数据库二进 ...

  7. CentOS 7 安装 LNMP 环境(PHP7 + MySQL5.7 + Nginx1.10)

    记录下在CentOS 7 安装 LNMP 环境(PHP7 + MySQL5.7 + Nginx1.10)过程笔记. 工具 VMware版本号 : 12.0.0 CentOS版本 : 7.0 一.修改 ...

  8. LNMP架构及DISCUZ论坛部署

    1)(5分)服务器IP地址规划:client:12.0.0.12/24,网关服务器:ens36:12.0.0.1/24.ens33:172.16.10.1/24,Web1:172.16.10.10/2 ...

  9. PHP从PHP5.0到PHP7.1的性能全评测

    本文是最初是来自国外的这篇:PHP Performance Evolution 2016, 感谢高可用架构公众号翻译成了中文版, 此处是转载的高可用架构翻译后的文章从PHP 5到PHP 7性能全评测( ...

随机推荐

  1. 深入了解JVM(Java虚拟机)

    虚拟机 JRE由Java API和JVM组成,JVM通过类加载器(Class Loader)加类Java应用,并通过Java API进行执行. 虚拟机(VM: Virtual Machine)是通过软 ...

  2. Android开发案例 - 淘宝商品详情【转】

    http://erehmi.cnblogs.com/ 所有电商APP的商品详情页面几乎都是和淘宝的一模一样(见下图): 采用上下分页的模式 商品基本参数 & 选购参数在上页展示 商品图文详情等 ...

  3. 使用iframe引入公共模块

    新建一个公共文件head.html <!DOCTYPE html><html lang="en"><head> <meta charset ...

  4. 12scrapy_redis

    一.简介 1.redis redis是一个key-value存储系统.和Memcached类似,它支持存储的value类型相对更多,包括string(字符串).list(链表).set(集合).zse ...

  5. CentOS7.4搭建kafka单结点和集群

    操作系统选择 CentOS7.4x86-64(操作系统的x86_64是跟CPU有关的,最早AMD公司开发出了一款向下兼容x86CPU,向上又扩充了指令集,具有了64位CPU的特性,这款CPU后来改名为 ...

  6. tornado框架基础03-请求与响应

    01 请求与响应 请求 浏览器在发送请求的时候,会发送具体的请求信息,由请求行,请求消息头,请求正文 请求消息头 向服务器传递附加信息 Accept: 浏览器可以接受的MIME类型. Accept-C ...

  7. Postfix mail for azengna.com loops back to myself -solve

    设置 /etc/postfix/main.cf 原配置 mydestination = $myhostname, localhost.$mydomain, localhost 改为 mydestina ...

  8. 【BZOJ 2462】矩阵模板 (二维哈希)

    题目 给定一个M行N列的01矩阵,以及Q个A行B列的01矩阵,你需要求出这Q个矩阵哪些在 原矩阵中出现过. 所谓01矩阵,就是矩阵中所有元素不是0就是1. 输入 输入文件的第一行为M.N.A.B,参见 ...

  9. 【HDU 6008】Worried School(模拟)

    Problem Description You may already know that how the World Finals slots are distributed in EC sub-r ...

  10. POJ 2349 Arctic Network(贪心 最小生成树)

    题意: 给定n个点, 要求修p-1条路使其连通, 但是现在有s个卫星, 每两个卫星可以免费构成连通(意思是不需要修路了), 问修的路最长距离是多少. 分析: s个卫星可以代替s-1条路, 所以只要求最 ...