美文网首页
Centos7.6源码安装PHP7.4.3

Centos7.6源码安装PHP7.4.3

作者: 喜欢上一个妖精 | 来源:发表于2020-02-28 15:35 被阅读0次
  • 下载PHP安装包
    • wget https://www.php.net//distributions/php-7.4.3.tar.gz
  • 解压安装包
    • tar -zxvf php-7.4.3.tar.gz
  • 进入解压目录
    • cd php-7.4.3
./configure --prefix=/usr/local/php74 --with-config-file-path=/usr/local/php74/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --enable-mbstring --enable-mysqlnd
  • 报错1:configure: error: Package requirements (libxml-2.0 >= 2.7.6) were not met:No package 'libxml-2.0' found
 yum install -y libxml2-devel
  • 报错2:configure: error: Package requirements (sqlite3 > 3.7.4) were not met:No package 'sqlite3' found
        yum install -y libcurl-devel

  • 报错3:configure: error: Package requirements (oniguruma) were not met:No package 'oniguruma' found
yum install -y https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/o/oniguruma-5.9.5-3.el7.x86_64.rpm
yum install -y https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/o/oniguruma-devel-5.9.5-3.el7.x86_64.rpm
  • make

  • make install

  • 安装成功如图: install.png
  • 为可执行php文件,建立软链接

    • cd /usr/local/sbin
    • ln -s /usr/local/php74/bin/php php74
  • 查看php版本:php74 -v

    version.png

相关文章

网友评论

      本文标题:Centos7.6源码安装PHP7.4.3

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