php 升级php5.5 、php7
rpm -Uvh http:
//mirror
.webtatic.com
/yum/el6/latest
.rpm
yum
install
php55w php55w-opcache
yum
install
yum-plugin-replace
yum replace php-common --replace-with=php55w-common
wget 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 添加如下 ...
随机推荐
- Maven报错:Missing artifact jdk.tools:jdk.tools:jar:1.6
1.jdk.tools:jdk.tools是与JDK一起分发的一个JAR文件,可以如下方式加入到Maven项目中: <dependency> <groupId>jdk.t ...
- 解决使用phpmyadmin导出导入数据库时提示的“超出长度”、“超时”问题
IIS请求筛选模块被配置为拒绝超过请求内容长度的请求 1. 修改IIS的applicationhost.config a.文件位置: %windir%/system32/inetsrv/config/ ...
- 【转载】#324 - A Generic Class Can Have More than One Type Parameter
A generic class includes one or more type parameters that will be substituted with actual types when ...
- DedeCms中出现Safe Alert: Request Error step 1/2 的解决方法
dedecms安全警告:Safe Alert: Request Error step 2!不知道大家有没有发现这个现象.只从Dedecms官方公布了之前的版本有严重的漏洞以来,现在在仿站的时候都是采用 ...
- React的安装
创建: 2019/05/01 完成: 2019/05/01 create-react-app 学习及创建单页app npx create-react-app my-app cd my-app npm ...
- python 3+djanjo 2.0.7简单学习(一)
1.安装django pip install django 我这里已经安装过了 整个目录结构如下: votes : migrations : __init__.py : admin.py : apps ...
- 某寺庙,有小和尚、老和尚若干。有一水缸,由小和尚用水桶从井中提水入缸,老和尚用水桶从缸里取水饮用。水缸可容10桶水,水取自同一井中。水井径窄,每次只能容一个水桶取水。水桶总数为3个。每次入、取缸水仅为1桶,且不可以同时进行。试用P、V操作给出小和尚、老和尚动作的算法描述。
寺庙和尚打水 设信号量mutex_gang, mutex_jing, gang_empty, gang_full, count分别表示使用缸互斥, 使用井互斥, 缸空, 缸满, 水桶总个数 semap ...
- 2017.11.23 利用Cookie管理实现自动登陆
Cookie管理 Cookie对象是由服务器产生并保存在客户端的信息,常用他记录用户个人信息以及个性化设置.用户每次访问网点时,应用程序就可以检索以前保存的信息 Cookie对象属于的类是javax. ...
- 用dynamic的方式来转换Json对象
来自这里:http://stackoverflow.com/questions/3142495/deserialize-json-into-c-sharp-dynamic-object If you ...
- Linux(二) - Unix&Linux 基本概念
主机 = 内核 + 实用工具 内核(kernel) 当计算机启动时,计算机要经历一系列动作,这些动作构成了引导过程.引导过程的最后一个动作是启动一个非常复杂的程序,该程序就被称为内核(Kernel) ...