OpenEuler22源码安装PHP8.2

本文详细描述了在Linux系统中安装PHP8.2.7的过程,包括先安装相关依赖,如freetype、gd、libxml等,接着下载并编译oniguruma库,最后下载PHP源码,配置并编译安装PHP,同时启用fpm,并指定与nginx用户关联。

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

1.安装相关依赖

dnf -y install autoconf freetype gd libpng libpng-devel libjpeg libxml2 libxml2-devel zlib curl curl-devel net-snmp-devel libjpeg-devel php-ldap openldap-devel openldap-clients freetype-devel gmp-devel libzip libzip-devel sqlite-devel automake libtool*

2.安装oniguruma库

yum install autoconf automake libtool
wget https://github.com/kkos/oniguruma/releases/download/v6.9.8/onig-6.9.8.tar.gz -O oniguruma-6.9.8.tar.gz 
tar zxvf oniguruma-6.9.8.tar.gz 
cd  onig-6.9.8
autoreconf -vfi
./configure --prefix=/usr
make && make install

dnf  -y install oniguruma-devel

3.下载php软件包并解压以及编译

wget https://www.php.net/distributions/php-8.2.7.tar.gz
tar zxvf php-8.2.7.tar.gz
cd php-8.2.7
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysqli=shared,mysqlnd --with-pdo-mysql --enable-opcache --enable-gd --with-iconv  --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 --without-pear --with-gettext --enable-session --with-curl --with-jpeg --with-freetype --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --without-gdbm --enable-fast-install --disable-fileinfo

 make && make install

4.查看是否安装成功
 

php -v
如出现如下内容,则安装成功
PHP 8.0.28 (cli) (built: Feb 14 2023 11:05:44) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.28, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.28, Copyright (c), by Zend Technologies

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值