召隆企博汇论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 1208|回复: 0

Centos 源代码安装PHP7

[复制链接]

20

主题

0

回帖

294

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
294
发表于 2019-11-30 15:02:19 | 显示全部楼层 |阅读模式
本例中使用的是apaches作为服务器,如果使用nginx请另外找方法$ H. u6 l9 i1 N
首先安装必要的系统支持文件
  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,
; q2 n( v1 ?0 [: K% i5 ~; R: E
9 d2 X1 a; F7 R3 J下载安装libzip ,在PHP中需要使用这个扩展: N/ r: F  o# m
  1. wget https://libzip.org/download/libzip-1.5.2.tar.gz
    " b9 m4 r1 D4 m4 [5 W
  2. mkdir build
    * M, S( l& S0 M( v
  3. cd build; `  f4 ^% i3 y
  4. cmake3 ..
    / ~5 S0 \$ @! I# ]; i
  5. make ; `/ g/ H, |8 n# P# X: K
  6. make install
复制代码
之后就可以下载PHP最新版本了+ c0 D; \/ f# F4 U" Q# m
安装命令如下 :
- r8 c5 L+ C" J; N1 V, r  h2 M
  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
复制代码

, U# N  n9 T. L, _7 t7 R
. w% d1 h! v& k6 W; O. l8 ]2 Q
" N+ o6 k0 ^, E% Y% [
+ f1 L5 \; q4 i+ Y2 Y4 I) S  {  F4 {7 S- a# j% B: t0 j  b4 l

9 l8 S5 I! S0 }' x3 q
6 y# h" ~, u0 ^/ H4 e6 t9 @
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-6-2 02:48 , Processed in 0.033104 second(s), 25 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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