PHP 7.4 在CentOS下的编译安装
一:安装前的准备
安装依赖包
yum -y install libmcrypt-devel mhash-devel libxslt-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel sqlite-devel sqlite gcc automake autoconf libtool make gcc-c++ glibc wget
手动部分其他依赖包
cd /home wget https://github.com/kkos/oniguruma/archive/v6.9.4.tar.gz -O oniguruma-6.9.4.tar.gz tar -xvf oniguruma-6.9.4.tar.gz cd oniguruma-6.9.4/ ./autogen.sh ./configure --prefix=/usr --libdir=/lib64 make && make install
二:获取php安装包安装
cd /home wget https://mirrors.sohu.com/php/php-7.4.16.tar.gz tar -zxvf php-7.4.16.tar.gz cd php-7.4.16 ./configure --prefix=/usr/local/php --enable-fpm --with-mcrypt --enable-mbstring --disable-pdo --with-curl --disable-debug --disable-rpath --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --with-mhash --enable-zip --with-pcre-regex --with-mysql --with-mysqli --with-gd --with-jpeg-dir make all install
三:做一些配置
cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf cd /usr/local/php/etc/php-fpm.d cp www.conf.default www.conf cd /usr/local/php/bin cp php /usr/bin