源码安装PHP7.4.33开启php-ldap php-zip php-zlib php-gd等模块

#下载
wget -c https://www.php.net/distributions/php-7.4.33.tar.gz
tar -zxvf  php-7.4.33.tar.gz
cd php-7.4.33
#安装依赖
[root@appserver php-7.4.33]# yum -y install gd curl curl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel
[root@appserver php-7.4.33]# yum -y install openldap-devel openldap-servers openldap-clients
[root@appserver php-7.4.33]# cp -r /usr/lib64/libldap* /usr/lib/
[root@appserver php-7.4.33]# yum install sqlite-devel libwebp-devel libicu-devel
#安装oniguruma与oniguruma-devel
[root@appserver php-7.4.33]# yum install https://rpms.remirepo.net/enterprise/7/remi/x86_64/oniguruma5php-6.9.9-1.el7.remi.x86_64.rpm
[root@appserver php-7.4.33]# yum install https://rpms.remirepo.net/enterprise/7/remi/x86_64/oniguruma5php-devel-6.9.9-1.el7.remi.x86_64.rpm
# 安装libzip
wget https://libzip.org/download/libzip-1.3.2.tar.gz
tar xvf libzip-1.3.2.tar.gz
cd libzip-1.3.2
./configure
make
make install
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/" 
#预编译
  ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir --with-freetype --with-jpeg --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --enable-intl --enable-ftp --enable-gd --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-soap --with-gettext --disable-fileinfo --enable-opcache  --with-webp --with-zip --with-ldap   --enable-debug  --with-gd  --with-jpeg-dir  --with-png-dir  --with-freetype-dir  --enable-mbstring     --with-config-file-path=/usr/local/php/etc  --with-zlib-dir --with-openssl-dir=/usr/bin/openssl  

make && make install
#在MAKE时如果报错:如果报错/usr/bin/ld: ext/ldap/.libs/ldap.o: undefined reference to symbol 'ber_memfree',按如下操作:vi Makefile
#找到 开头是 'EXTRA_LIBS' 这一行 在结尾加上 '-llber' 然后执行 make && make install

cp php.ini-development /usr/local/php/etc/php.ini
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod +x  /etc/init.d/php-fpm
export PATH=$PATH:/usr/local/php/bin
[root@appserver php-7.4.33]# cp /usr/local/php/etc/php-fpm.d/www.conf.default  /usr/local/php/etc/php-fpm.d/www.conf
/etc/init.d/php-fpm start
  • 8
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

阿蔡BLOG

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值