php 升级php5.5 、php7
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
yum install php55w php55w-opcache
yum install yum-plugin-replaceyum replace php-common --replace-with=php55w-commonwget http://cn2.php.net/get/php-7.0.2.tar.gz/from/this/mirror
tar -zxvf php-7.1..tar.gz
卸载之前php
yum remove php
rpm -qa|grep php //php相关列表
rpm -e php-cli-5.4.-.el7.x86_64 //逐一删除
安装前准备支持
yum install libxmal2 libxml2-devel openssl openssl-devel curl curl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel pcre pcre-devel libxslt libxslt-devel bzip2 bzip2-devel
configure
./configure --prefix=/usr/local/php --with-curl --with-freetype-dir --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite --with-pear --with-png-dir --with-jpeg-dir --with-xmlrpc --with-xsl --with-zlib --with-bz2 --with-mhash --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-gd-native-ttf --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-sysvshm --enable-xml --enable-zip
Error:
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for cc... no
checking for gcc... no
configure: error: in `/home/cloud-user/php-7.1.':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
需要install gcc
yum install gcc
configure
./configure --prefix=/usr/local/php --with-curl --with-freetype-dir --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite --with-pear --with-png-dir --with-jpeg-dir --with-xmlrpc --with-xsl --with-zlib --with-bz2 --with-mhash --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-gd-native-ttf --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-sysvshm --enable-xml --enable-zip
出现错误,解决方案
1)freetype.h not fount => yum install freetype-devel
2)onfigure: error: Please reinstall the libcurl distribution - easy.h should be in /include/curl/ => yum install curl curl-devel
3)cannot find openssl's<evp.h> => yum install openssl openssl-devel
4)configure error xml2-config not found. please check your libxml2 installation => yum install libxml2 libxml2-devel
5)png.h not found. => yum install libpng-devel

make && make install时间较长
make && make install
配置相应文件
cp php.ini-development /usr/local/php/php.ini
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
cp sapi/fpm/php-fpm /usr/local/bin
设置php.ini
vi /usr/local/php/php.ini
打开php配置文件找到cgi.fix_pathinfo配置项,这一项默认被注释并且值为1,根据官方文档的说明,这里为了当文件不存在时,阻止Nginx将请求发送到后端的PHP-FPM模块,从而避免恶意脚本注入的攻击,所以此项应该去掉注释并设置为0
修改php-fpm
然后网上一些教程说让修改php-fpm.conf添加以上创建的用户和组,
find / -name php-fpm.conf
vim ....php-fpm.conf
修改
默认情况下etc/php-fpm.d/下有一个名为www.conf.defalut的配置用户的文件,执行下面命令复制一个新文件并且打开:
cp www.conf.default www.conf
vi www.conf
默认user和group的设置为nobody,将其改为合适的。
启动php-fpm
/usr/local/bin/php-fpm
php-fpm服务默认使用9000端口,使用 netstat -tln | grep 9000 可以查看端口使用情况:
yum install参考网址:http://www.centoscn.com/image-text/install/2015/1222/6560.html
更新静项原
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
Error
epel-release >= 被 webtatic-release--.noarch 需要
解决
yum install epel-release
yum install
yum install php70w php70w-bcmath php70w-cli php70w-common php70w-dba php70w-devel php70w-embedded php70w-enchant php70w-fpm php70w-gd php70w-imap php70w-interbase php70w-intl php70w-ldap php70w-mbstring php70w-mcrypt php70w-mssql php70w-mysql php70w-odbc php70w-opcache php70w-pdo php70w-pecl-memcache php70w-pecl-xdebug php70w-pgsql php70w-process php70w-pspell php70w-recode php70w-snmp php70w-soap php70w-tidy php70w-xml php70w-xmlrpc
nginx支持php,安装php时一定需要带php-fpm
先启动php-fpm
/usr/sbin/php-fpm
修改nginx.conf
location ~ \.php$ {
fastcgi_pass 127.0.0.1:;#php-fpm的默认端口是9000
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
重启nginx
systemctl restart nginx
写个phpinfo浏览器访问就可以:

或者:
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm //升级本地镜像源,可能会失败,多试几次
yum install
yum install php70w php70w-bcmath php70w-cli php70w-common php70w-dba php70w-devel php70w-embedded php70w-enchant php70w-fpm php70w-gd php70w-imap php70w-interbase php70w-intl php70w-ldap php70w-mbstring php70w-mcrypt php70w-mssql php70w-mysql php70w-odbc php70w-opcache php70w-pdo php70w-pecl-memcache php70w-pecl-xdebug php70w-pgsql php70w-process php70w-pspell php70w-recode php70w-snmp php70w-soap php70w-tidy php70w-xml php70w-xmlrpc
php 升级php5.5 、php7的更多相关文章
- centos6 下 yum 升级php5 到 php7
一 [卸载老版本php] 1.查看老版本 2.卸载老版本 yum remove php* 本人使用一下方式卸载老版本 1)yum -y remove php* #这个命令可以卸载部分,但是清除不干净 ...
- wdcp升级php5.8到php7.1.12
php7升级脚本 update_php7.sh #!/bin/bash # PHP update scripts ];then Ver= else Ver=$ fi Debugfile= echo & ...
- 如何在CentOS上升级php5.4至5.6?
如何在CentOS上升级php5.4至5.6? 2017-01-10技术运维PHPApacheCentOSLinux 由于CentOS的默认的php安装源版本都是5.4以下的,如果你的项目对php版本 ...
- Win 2003下IIS6+Mysql+php5.2 isapi搭建 升级php5.2到5.3测试 借助fastcgi实现
Win 2003下IIS6+Mysql+php5.2 原环境isapi搭建 升级php5.2到5.3测试 借助fastcgi实现 操作如下 实验前准备:php-5.3.5-Win32-VC6-x86 ...
- wamp升级php5.3.10到5.4.31版本
wamp升级php5.3.10到5.4.31版本 1. 停止WAMP服务器. 2. 去网站windows.php.net 下载php-5.4.31-nts-Win32-VC9-x86.zip. 不 ...
- PHP5和PHP7的安装、PHP和apache的整合!
1.PHP5的安装: 下载: wget -c http://cn2.php.net/distributions/php-5.6.36.tar.gz (php5) wget -c http://cn2 ...
- 快速升级PHP5.4、MySql5.5版本WDCP面板一键包
指定一键安装包环境升级PHP5.4版本 wget http://soft.sindns.net/wdcp/php_up54.sh sh php_up54.sh 直接登录SSH,下载和执行脚本自动会升级 ...
- wdcp升级php5.3无法安装PDO_MySQL的解决
重新下载php5.3的升级脚本 wget http://down.wdlinux.cn/in/php_up53.sh 不忙运行,先修改php_up53.sh,查找./configure字段,在这行的末 ...
- 安装最新版的wampserver,可以兼容php5和php7
本文介绍的wamp是Windows+Apache+MySQL+PHP+phpMyAdmin,主要应用于开发环境[一键安装包,简单好用]. 这是运行在Windows系统下的官方安装包,可以快速的搭建属于 ...
- 在Apache中安装php5.6 & php7.3
1.下载 httpd-2.4.41-win64-VC15.zip.php5.6 + vc11. php7.3 + vc14-16 2.配置httpd,在 httpd.conf L180 添加如下 ...
随机推荐
- C语言中 fputs() fgets() 的使用方法
一.读字符串函数fgets函数的功能是从指定的文件中读一个字符串到字符数组中,函数调用的形式为: fgets(字符数组名,n,文件指针): 其中的n是一个正整数.表示从文件中读出的字符串不超过 n-1 ...
- 开始用PyTorch
怎么说呢,TensorFlow有些实现过于蛋疼,我需要使用更实用的框架. 目前在读https://github.com/chenyuntc/pytorch-book
- 在IE中解决当前安全设置不允许下载该文件的方案
解决方案一: 1.0打开IE后,单击菜单栏中的“工具”菜单,在弹出的菜单中选择“Internet选项”命令: 2.0在弹出“Internet选项”的对话框中,打开“Internet选项”对话框: 3. ...
- BSP和JSP里的UI元素ID生成逻辑
CRM WebClient UI WebClient UI渲染出来的DOM元素的这些C#_W#格式的id是在哪行ABAP代码被生成出来的? 参考我的博客WebClient UI element ID ...
- IOS 线程的总结(及cell的图片下载)
零.线程的注意点(掌握) 1.不要同时开太多的线程(1~3条线程即可,不要超过5条)2.线程概念1> 主线程 : UI线程,显示.刷新UI界面,处理UI控件的事件2> 子线程 : 后台线程 ...
- Spring Bean依赖但注入(autowired或resource)时NullPointerException(xml和annotation混用的场景下)
项目中同时使用了xml和annotation的方式管理Spring Bean 启动时候报NullPointerException,依赖注入失败! 参考: http://fly0wing.iteye.c ...
- 不使用data-ng-app指令的表达式
<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content=&q ...
- this指向问题(1)
在JS中,this一般有四种绑定的方式,但是在确定到底是哪种绑定之前必须先找到函数的调用位置.接下来先介绍其中的三种: 1.默认绑定 其实所谓的默认绑定就是函数直接调用(前面没有什么东西来点它),在默 ...
- DB总结1
DBA 重构 data new york committee cobol codasyl journal DDL DML 关系演算 域关系演算语言(QBE) 元祖关系演算语言 ...
- (排班表二)后台动态绘制Grid表格
后台动态绘制值班表(Grid表格 列名不固定) 要求:表头除了值班人姓名,还要显示日期,及每天的星期值,用斜杠‘/’分隔.即:几号/星期几 最终实现的效果:根据查询的年月显示每个值班人查询月份每天的值 ...