召隆企博汇论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 2369|回复: 0

Centos 源代码安装PHP7

[复制链接]

20

主题

0

回帖

294

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
294
发表于 2019-11-30 15:02:19 | 显示全部楼层 |阅读模式
本例中使用的是apaches作为服务器,如果使用nginx请另外找方法
0 n3 S( s4 j( S% \首先安装必要的系统支持文件
  1. yum -y install autoconf epel-release wget unzip cmake cmake3 gcc gcc++ memcached-devel  libmemcached libmemcached-devel httpd httpd-devel httpd-tools memcached libzip  postgresql-devel libmcrypt libmcrypt-devel mcrypt mhash  libxml2 libxml2-devel gcc openssl openssl-devel curl curl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel pcre pcre-devel libxslt libxslt-devel bzip2 bzip2-devel
复制代码
安装以上项之后,可以安装最新的PHP版本,本例中使用的是PHP7.3.12,
1 e/ C& G6 e6 N9 {  u9 Y6 H9 R. S4 x/ J# k
下载安装libzip ,在PHP中需要使用这个扩展% k+ Z# n- H( Y$ G+ F
  1. wget https://libzip.org/download/libzip-1.5.2.tar.gz
    ; H. J. j( @% i+ {$ p
  2. mkdir build
    2 b, \9 O9 |( Q( g, B' R
  3. cd build  n' Q$ _1 W/ m" k
  4. cmake3 ..* Z; r8 `7 Q2 b5 J; C
  5. make 9 Y4 O9 m& v- _
  6. make install
复制代码
之后就可以下载PHP最新版本了2 a6 e# ?/ p* t, P
安装命令如下 :: T, |) ^4 S2 ?' O
  1. ./configure --prefix=/home/php/php7.3.12 --with-apxs2  --with-pdo-mysql  --enable-debug --enable-debug --with-libxml-dir --with-openssl  --with-zlib --with-bz2 --enable-calendar --with-curl   --with-libxml-dir   --with-gd --with-openssl-dir    --with-jpeg-dir   --with-png-dir    --with-zlib-dir    --with-freetype-dir    --with-gettext   --enable-mbstring   --with-mysqli   --with-pgsql   --enable-shmop   --with-libxml-dir   --with-openssl-dir     --enable-sockets    --with-libxml-dir   --with-zlib-dir   --enable-mysqlnd   --with-zlib-dir  --with-libzip   --enable-zip --with-pdo-pgsql
复制代码

  w' }% ~/ W% L! C2 s; Z8 r
8 T' e7 O2 B: K  h. Q0 }
+ d' s7 i9 z! j. G( `0 R! ^0 M9 `( U7 K3 ?. l3 a3 K

4 J0 \$ c' _, C% {) W
3 n. O8 Q/ l( }- d4 p/ L5 _: P% B% Y, K/ q+ @3 q% z% b
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|召隆企博汇 ( 粤ICP备14061395号 )

GMT+8, 2026-7-17 22:41 , Processed in 0.036541 second(s), 26 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表