linux系统PHP7降级安装PHP5,安装PHP5和PHP7

本文介绍了如何在Linux系统中将PHP7降级安装为PHP5。首先,从官方源下载PHP5.6.30的安装包并解压,然后通过配置安装选项,如--prefix、--with-apxs2等进行编译安装。在安装过程中,可能会遇到libxml2、openssl、bzip2、jpeg、png、freetype、mcrypt相关库的问题,通过yum安装相应开发包解决。安装完成后,配置php.ini文件,并检查PHP是否能被Apache正确调用。
摘要由CSDN通过智能技术生成

一、PHP5安装

PHP,是英文超文本预处理语言Hypertext Preprocessor的缩写。PHP 是一种 HTML 内嵌式的语言,是一种在服务器端执行的嵌入HTML文档的脚本语言。官网:www.php.net

1、下载并解压源码安装包

[root@zlinux bin]# cd /usr/local/src/

[root@zlinux src]# wget http://cn2.php.net/distributions/php-5.6.30.tar.bz2

[root@zlinux src]# tar jxf php-5.6.30.tar.bz2

2、配置安装

[root@zlinux src]# cd php-5.6.30/

[root@zlinux php-5.6.30]# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-pdo-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值