• Centos 下安装php


    1 从php 官网下载源安装包
    http://php.net/downloads.php

    // 安装php 扩展 2 yum install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel gmp gmp-devel libmcrypt libmcrypt-devel readline readline-devel libxslt libxslt-devel 3 4 // 编译 php 5

    ./configure
    --prefix=/usr/local/php
    --with-config-file-path=/etc
    --enable-fpm
    --enable-inline-optimization
    --disable-debug
    --disable-rpath
    --enable-shared
    --enable-soap
    --with-libxml-dir
    --with-xmlrpc
    --with-openssl
    --with-mhash
    --with-pcre-regex
    --with-sqlite3
    --with-zlib
    --enable-bcmath
    --with-iconv
    --with-bz2
    --enable-calendar
    --with-curl
    --with-cdb
    --enable-dom
    --enable-exif
    --enable-fileinfo
    --enable-filter
    --with-pcre-dir
    --enable-ftp
    --with-gd
    --with-openssl-dir
    --with-jpeg-dir
    --with-png-dir
    --with-zlib-dir
    --with-freetype-dir
    --enable-gd-native-ttf
    --enable-gd-jis-conv
    --with-gettext
    --with-gmp
    --with-mhash
    --enable-openssl
    --enable-curl
    --enable-json
    --enable-mbstring
    --enable-mbregex
    --enable-mbregex-backtrack
    --with-libmbfl
    --with-onig
    --enable-pdo
    --with-mysqli=mysqlnd
    --with-pdo-mysql=mysqlnd
    --with-zlib-dir
    --with-pdo-sqlite
    --with-readline
    --enable-session
    --enable-shmop
    --enable-simplexml
    --enable-sockets
    --enable-sysvmsg
    --enable-sysvsem
    --enable-sysvshm
    --enable-wddx
    --with-libxml-dir
    --with-xsl
    --enable-zip
    --enable-mysqlnd-compression-support
    --with-pear
    --enable-opcache

    
    6 
    7  // 安装
    8 
    9 make && make install

    如果出现启动不了fpm的情况

    # cd /usr/local/php/etc/php-fpm.d/

    # cp www.conf.default www.conf

    # /usr/local/php/sbin/php-fpm -t

    [12-Oct-2017 08:33:29] NOTICE: configuration file /usr/local/php/etc/php-fpm.conf test is successful [root@localhost php-fpm.d]# service php-fpm start Starting php-fpm  done

     配置php

    cp php.ini-production /etc/php.ini
    cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
    cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf
     
    cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
    chmod +x /etc/init.d/php-fpm
     

    php.ini 目录

    /usr/local/php/etc/php.ini

    干掉 php 进程

    pkill -9 php-fpm

    如果php -v 不能识别命令 添加环境变量

     export PATH=$PATH:/usr/local/php/bin

  • 相关阅读:
    线性代数(不完全)与矩阵合集
    最短路合集
    [SP2878]KNIGHTS
    Noip 提高组系列题解目录
    【code】最小费用最大流(Dinic / zkw) 模板
    题解 DTOJ #1002.调整(tweak)
    题解 DTOJ #1008.生成输入数据 (input)
    题解 DTOJ #3861.基里巴斯(path)
    模板 · ISAP网络流+GAP优化+弧优化
    代码 · DTOJ.飞行员配对方案
  • 原文地址:https://www.cnblogs.com/zhanghanwen16/p/8569142.html
Copyright © 2020-2023  润新知