centos7安装php7.4

本文介绍了如何在CentOS7和Ubuntu系统中下载并安装PHP7.4,包括必要的依赖软件和配置参数。在CentOS7中,使用yum命令安装依赖并下载PHP源码,然后通过./configure进行配置。在Ubuntu系统中,使用apt-get安装相应包。PHP7.4的configure参数详列,展示了如何定制安装选项,包括启用GD库、mysqli、pdo_mysql等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

centos7

下载

wget https://www.php.net/distributions/php-7.4.10.tar.gz

安装依赖软件

yum install openssl-devel libxml2-devel bzip2-devel \
libcurl-devel libjpeg-devel libpng-devel freetype-devel \
libmcrypt-devel recode-devel libicu-devel libzip-devel\
libxml2-devel sqlite-devel bzip2-devel libcurl-devel libicu-devel

yum install https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/o/oniguruma-6.8.2-1.el7.x86_64.rpm
yum install https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/o/oniguruma-devel-6.8.2-1.el7.x86_64.rpm

 

ubuntu

apt -y install libfcgi-dev libfcgi0ldbl libjpeg-turbo8-dev libmcrypt-dev libssl-dev libc-client2007e libc-client2007e-dev libxml2-dev libbz2-dev libcurl4-openssl-dev libjpeg-dev libpng-dev libfreetype6-dev libkrb5-dev libpq-dev libxml2-dev libxslt1-dev libzip-dev libsqlite3-dev libonig-dev libcurl4-openssl-dev
 libssl-dev

 

 php7.4configure参数php7.4configure参数

 

./configure  --prefix=/usr/local/php74 --exec-prefix=/usr/local/php74 --bindir=/usr/local/php74/bin --sbindir=/usr/local/php74/sbin --includedir=/usr/local/php74/include --libdir=/usr/local/php74/lib/php --mandir=/usr/local/php74/php/man --with-config-file-path=/usr/local/etc/cgi  --with-mhash --with-openssl --with-mysqli=shared,mysqlnd --with-pdo-mysql=shared,mysqlnd --enable-gd --with-iconv --with-zlib --with-zip --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-mbregex --enable-mbstring --enable-ftp  --enable-pcntl --enable-sockets --with-xmlrpc --enable-soap  --with-gettext --enable-session --with-curl --with-jpeg --with-freetype --enable-opcache --enable-fpm --with-fpm-user=www --with-fpm-group=www --without-gdbm --disable-fileinfo

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值