美文网首页
Linux系统 php7.4 编译安装

Linux系统 php7.4 编译安装

作者: 宇VS然 | 来源:发表于2024-03-24 08:30 被阅读0次

一,下载解压

   wget https://www.php.net/distributions/php-7.4.30.tar.gz
   tar -xzf php-7.4.30.tar.gz
   cd php-7.4.30

二,编译安装

./configure --prefix=/usr/local/php74 \
--with-config-file-path=/usr/local/php74/etc \
--with-config-file-scan-dir=/usr/local/php74/etc/conf.d \
--with-fpm-user=www \
--with-fpm-group=www \
--with-pear \
--with-curl \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--with-zlib \
--with-iconv-dir \
--with-mhash \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-openssl \
--with-xsl \
--with-recode \
--with-libxml-dir \
--with-xmlrpc \
--with-gettext \
--enable-mysqlnd \
--enable-mysqlnd-compression-support \
--enable-sockets \
--enable-soap \
--enable-mbstring \
--enable-gd-jis-conv \
--enable-zip \
--enable-xml \
--enable-bcmath \
--enable-calendar \
--enable-shmop \
--enable-dba \
--enable-wddx \
--enable-sysvsem \
--enable-sysvshm \
--enable-sysvmsg \
--enable-opcache \
--enable-pcntl \
--enable-fpm \
--enable-maintainer-zts \
--disable-debug


make && make install

三,添加

vi /etc/profile

添加内容:
PATH=$PATH:/usr/local/php/bin
export PATH

source /etc/profile

四,设置配置文件

根据环境,复制一个到 /usr/local/php/etc 下面,并改名为 php.ini

sudo cp php.ini-development /usr/local/php74/etc/php.ini

检查php版本及扩展

php -v
php -m

五,安装php-fpm
如果需要启动fpm,还需要继续进行

cd sapi/fpm
sudo cp init.d.php-fpm /etc/init.d/php74-fpm
sudo chmod +x /etc/init.d/php74-fpm
sudo chkconfig --add php74-fpm
sudo chkconfig php74-fpm on

sudo cp /usr/local/php74/etc/php-fpm.conf.default /usr/local/php74/etc/php-fpm.conf
sudo cp /usr/local/php74/etc/php-fpm.d/www.conf.default /usr/local/php74/etc/php-fpm.d/www.conf

sudo /etc/init.d/php74-fpm start

相关文章

  • CentOS7编译安装PHP时 configure: error

    操作系统:CentOS7安装版本:PHP7.4 1)编译安装PHP7.4的时候报错信息如下 2)解决方法 3)再执行编译

  • CentOS7编译安装PHP时 configure: error

    操作系统:CentOS7安装版本:PHP7.4 1)编译安装PHP7.4的时候报错信息如下 这里是没有找到libz...

  • Linux编译安装php7.4

    Linux编译安装php,不管版本,其实流程是一致 安装依赖 安装libzip 编译安装php 参数解析 配置ph...

  • Mesos 安装

    安装 系统要求: 64位的linux或mac系统 安装: 1.源码编译安装(centos 7.0) 编译环境准备 ...

  • centos8 编译 安装 php7.x 出现 Package

    centos8 在编译安装 PHP7.4时,会报 Package requirements (oniguruma...

  • 一、Mysql安装

    环境:Linux系统 mysql编译安装 关闭防火墙和selinux 1、编译安装mysql5.7 1、清理安装环...

  • LNMP环境配置

    Linux 系统环境:CentOs 7 Nginx 安装 一.源码安装(未实践) 1)新系统要安装编译工具$ yu...

  • Lua 环境安装

    Linux 系统上安装 Linux & Mac上安装 Lua 安装非常简单,只需要下载源码包并在终端解压编译即可,...

  • Redis初探

    安装 Linux系统,在官网下载Redis 源码,按照README中的描述编译安装。 Windows系统,Gith...

  • Redis 安装

    本文介绍基于 Linux 系统的 Redis 编译安装 一、安装 1、安装 gcc 环境 2、下载 redis 安...

网友评论

      本文标题:Linux系统 php7.4 编译安装

      本文链接:https://www.haomeiwen.com/subject/zjgftjtx.html