本文主要是介绍php7.4编译,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
下载源码
安装依赖
编译
配置环境变量
1.下载源码
cd /usr/src
wget http://php.net/distributions/php-7.4.0.tar.gz
tar -zxvf php-7.4.0.tar.gz
cd php-7.4.0
2.安装依赖
yum install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel gmp gmp-devel libmcrypt libmcrypt-devel readline readline-devel libxslt libxslt-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel ncurses curl gdbm-devel db4-devel libXpm-devel libX11-devel gd-devel gmp-devel expat-devel xmlrpc-c xmlrpc-c-devel libicu-devel libmcrypt-devel libmemcached-devel libzip-devel
3.编译
./configure --prefix=/php/php7.4 --with-config-file-path=/etc --with-fpm-user=www --with-fpm-group=www --with-curl --enable-gd --enable-mbstring --with-openssl --with-zip --with-zlib --with-pdo-mysql --enable-fpm
4.配置环境
#配置环境变量
vim /etc/profile
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/"
export PATH=$PATH:/php/php7.4/bin/
source /etc/profile
#准备配置文件
2.准备配置文件
cp php.ini-production /etc/php.ini
cp /php/php7.4/etc/php-fpm.conf.default /php/php7.4/etc/php-fpm.conf
cp /php/php7.4/etc/php-fpm.d/www.conf.default /php/php7.4/etc/php-fpm.d/www.conf
cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod +x /etc/init.d/php-fpm
service php-fpm start
这篇关于php7.4编译的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!