一、安装依赖
yum install zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel libxslt-devel
二、安装php
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-png-dir=/usr/local/libpng --with-jpeg-dir=/usr/local/jpeg --with-freetype-dir=/usr/local/freetype --with-zlib-dir=/usr/local/zlib --with-mcrypt=/usr/local/libmcrypt --with-libxml-dir=/usr/local/libxml2/ --with-iconv-dir=/usr/local/libiconv --enable-libxml --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-opcache --enable-mbregex --enable-fpm --enable-mbstring=all --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-curl --enable-ctype --enable-shared --with-gd --disable-fileinfo
安装php7.2.12
./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 --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-xml --enable-zip
三、卸载php
首先先要列出php的安装包
在命令行键入
# rpm -qa|grep php
会列出php相关的安装包
输入rpm -e 加包名卸载该软件,所列出的包名依次进行卸载
只要记住命令还是不难的,当然apache也得卸载重装
过程是一样的
过程中会有一些比较顽强的包不好卸载,可以用这个命令来卸载
# rpm -e 程序包名 --nodeps