源码编译安装7.0.5 https://www.php.net/ https://www.php.net/downloads.php rpm -ivh http://dl.fedorproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm rpm -ivh epel-release-7-6.noarch.rpm [root@gitlab lamp]# cd /etc/yum.repos.d/ [root@gitlab yum.repos.d]# ls CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo epel.repo.rpmnew CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo epel.repo epel-testing.repo [root@gitlab yum.repos.d]# yum clean all [root@gitlab yum.repos.d]# yum list [root@gitlab yum.repos.d]# yum -y install php-mcrypt libmcrypt libmcrypt-devel autoconf freetype gd libmcrypt libpng libpng-devel libjpeg libxm12 libxm12-devel zlib curl curl-devel [root@gitlab LAMPutil]# tar -xvf php-7.0.7.tar.gz [root@gitlab LAMPutil]# ./configure --prefix=/server/php7 --with-apxs2=/usr/local/apache2/bin/apxs --enable-mbstring --with-curl --with-gd --enable-fpm --enable-mysqlnd --with-pdo-mysql=mysqlnd --with-config-file-path=/server/php7/etc/ --with-mysqli=mysqlnd --with-mysql-sock=/server/mysql/mysql.sock make test 测试 make install [root@gitlab php-7.0.7]# cp php.ini-production /server/php7/etc/php.ini [root@gitlab php-7.0.7]# vim /usr/local/apache2/conf/httpd.conf Addtype application/x-httpd-php .php .phptml wq cd /usr/local/apache2/htdocs/ vim a.php
<?php phpinfo(); ?>wq service apachectl restart