召隆企博汇论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 638|回复: 0

Centos 源代码安装PHP7

[复制链接]

20

主题

20

帖子

292

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
292
发表于 2019-11-30 15:02:19 | 显示全部楼层 |阅读模式
本例中使用的是apaches作为服务器,如果使用nginx请另外找方法
+ T+ t/ E) D) ~2 K# C2 c; o$ L首先安装必要的系统支持文件
  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,
8 i9 ], c6 M  q" p- G/ Y) B2 |0 k/ F
下载安装libzip ,在PHP中需要使用这个扩展
. U* C4 l$ n% F2 }, G) h. @
  1. wget https://libzip.org/download/libzip-1.5.2.tar.gz% E( Y( Z" J+ P) c
  2. mkdir build
    4 m0 k4 N8 S9 _! ], H
  3. cd build
    - H% `3 E& x# l* H6 x
  4. cmake3 ..- G  g3 h8 Q0 w5 d6 Z7 h9 L6 i6 x
  5. make
    4 n/ ?0 m  m7 K: O, Z7 F
  6. make install
复制代码
之后就可以下载PHP最新版本了* H8 r9 H3 v  L5 `" E5 p+ m; }
安装命令如下 :
3 p, E% Q, Q, ^: y2 D
  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
复制代码

8 h  i! w! |. p  z6 X
/ N3 v' t8 ?- C6 D9 d# \6 i
! X7 w) f# H4 R" C9 W2 ~
+ j# }8 S* M/ x! w0 I$ v" j% W4 l) L7 r) A. a/ [
9 o2 Z4 @5 M; B, d8 t2 X9 p. W8 T
. s+ B8 M. M- v) j) [9 [
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-18 12:49 , Processed in 0.058864 second(s), 25 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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