zoukankan      html  css  js  c++  java
  • centos7 编译安装 php7.3.11

    1.安装依赖

     1 yum install -y libxml2 *openssl* libcurl* libjpeg* libpng* freetype* libmcrypt* gcc gcc-c++ 

    2.安装php
      2.1)解决依赖+1

      因为测试发现的一个问题,php安装依赖 libzip(需安装1.5.1的版本),然后蛋疼的事情发生了,libzip1.5.1版本需要cmake3.0.2以上版本

      接下来先解决cmake的版本(我直接使用的cmake3.6.2,这肯定是满足需求了吧):
      安装包:

     1 wget https://cmake.org/files/v3.6/cmake-3.6.2.tar.gz 

      安装:

     1 #编译
     2 tar xvf cmake-3.6.2.tar.gz && cd cmake-3.6.2/
     3 #安装
     4 ./bootstrap
     5 gmake
     6 gmake install
     7 #测试版本
     8 /usr/local/bin/cmake --version
     9 #查看系统rpm的cmake包
    10 rpm -qa |grep cmake
    11 #卸载系统的cmake
    12 yum remove cmake -y
    13 #软链接并进行测试版本
    14 ln -s /usr/local/bin/cmake /usr/bin/
    15 cmake --version

      2.2)解决依赖+2

      php安装依赖 libzip1.5.1

    #如果系统有低版本的libzip需先卸载
    rpm -qa| grep libzip
    yum remove libzip*
    
    # 源码编译安装 libzip 最新版
    # libzip 官网地址:https://libzip.org
    wget https://nih.at/libzip/libzip-1.5.1.tar.gz
    tar -zxvf libzip-1.5.1.tar.gz
    cd libzip-1.5.1
    ## 查看 INSTALL.md 其中有安装提示
    mkdir build
    cd build
    cmake ..
    make
    make test
    make install

    重头戏php编译安装

    php官方安装包和文档:

    http://www.linuxfromscratch.org/blfs/view/svn/general/php.html

    先去官方下载安装包!!!

    开始解压编译安装

     1 #解压
     2 xz -d php-7.3.11.tar.xz
     3 tar xf php-7.3.11.tar
     4 cd php-7.3.11
     5 
     6 #安装(也可以根据官方)
     7 ./configure --prefix=/usr/local/php --with-mysqli --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir --enable-simplexml --enable-xml --disable-rpath --enable-bcmath --enable-soap --enable-zip --with-curl --enable-fpm --with-fpm-user=www --with-fpm-group=www --enable-mbstring --enable-sockets --with-gd --with-openssl --with-mhash --enable-opcache --disable-fileinfo
     8 
     9 make
    10 make install

    配置

     1 #主要是解决测试启动配置文件
     2 cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
     3 cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf
     4 
     5 #启动试试能不能启动
     6 /usr/local/php/sbin/php-fpm

    命令行下运行php,需要将可执行文件复制到环境变量

    cp /usr/local/php/bin/php /usr/local/bin/php
    
    # 命令行下查看 php 版本
    php -v
  • 相关阅读:
    轻量级数据库sqlite的使用
    Integer引发的思考
    css限制显示行数
    数据库 chapter 17 数据仓库与联机分析处理技术
    数据库 chapter 15 对象关系数据库系统
    数据库 chapter 16 XML数据库
    数据库 chapter 14 分布式数据库系统
    数据库 chapter 11 并发控制
    数据库 chapter 12 数据库管理系统
    数据库 chapter 13 数据库技术新发展
  • 原文地址:https://www.cnblogs.com/gaoguangjun/p/11904698.html
Copyright © 2011-2022 走看看