Centos7 编译安装PHP7.4


yum -y install gcc gcc-c++ openssl openssl-devel libxml2 libxml2-devel curl-devel libjpeg-devel bzip2-devel.x86_64 libXpm-devel gmp-devel icu libicu libicu-devel php-mcrypt libmcrypt libmcrypt-devel postgresql-devel libxslt-devel libpng-devel libpng freetype-devel


wget https://nih.at/libzip/libzip-1.2.0.tar.gz
tar xf libzip-1.2.0.tar.gz
cd libzip-1.2.0
make && make install


wget https://www.php.net/distributions/php-7.4.0.tar.gz
tar xf php-7.4.0.tar.gz
cd php-7.4.0


./configure –prefix=/usr/local/php –enable-opcache –with-config-file-path=/usr/local/php/etc –with-curl –enable-fpm –enable-gd –with-iconv –enable-mbstring –with-mysqli=mysqlnd –with-openssl –enable-static –enable-sockets –enable-inline-optimization –with-zlib –disable-ipv6 –disable-fileinfo –disable-debug

如提示“No package ‘oniguruma’ found”需要安装 oniguruma包(可以参考 https://github.com/kkos/oniguruma#install):

yum install https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/o/oniguruma-5.9.5-3.el7.x86_64.rpm
yum install https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/o/oniguruma-devel-5.9.5-3.el7.x86_64.rpm

如提示“No package ‘sqlite3’ found:

wget -P /data/tmp https://sqlite.org/2019/sqlite-autoconf-3280000.tar.gz
cd /data/tmp/ && tar xf sqlite-autoconf-3280000.tar.gz
cd sqlite-autoconf-3280000
make && make install
whereis sqlite3
mv /usr/bin/{sqlite3,sqlite3.7}
cp /usr/local/bin/sqlite3 /usr/bin/sqlite3
sqlite3 –version
export LD_LIBRARY_PATH=”/usr/local/lib”
yum install sqlite-devel

然后执行make && make install 开始编译


34 条评论

  1. Adipex retard kaufen

    I simply couldn’t depart your web site before suggesting that I actually enjoyed the standard info a person supply in your guests? Is gonna be again steadily in order to check out new posts

  2. Online Kaufen

    Hello.This article was extremely fascinating, particularly because I was investigating for thoughts on this matter last Friday.

  3. Hello, you used to write magnificent, but the last several posts have been kinda boring… I miss your super writings. Past few posts are just a little out of track! come on!

  4. I went over this internet site and I believe you have a lot of great information, saved to fav (:.