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

    yum install libxml2-devel curl-devel openjpeg openjpeg-devel openjpeg-libs libjpeg libpng freetype libjpeg libpng-devel freetype-devel  mcrypt php-mcrypt libmcrypt libmcrypt-devel

    1.创建php用户和用户组:

     groupadd -r php && useradd -r -g php -s /bin/flase -M /usr/local/php7   

    2.编译安装(以php-fpm 方式安装):

    ./configure --prefix=/usr/local/php7 --exec-prefix=/usr/local/php7 --bindir=/usr/local/php7/bin --sbindir=/usr/local/php7/sbin --includedir=/usr/local/php7/include --libdir=/usr/local/php7/lib/php --mandir=/usr/local/php7/php/man --with-config-file-path=/usr/local/php7/etc --with-mysql-sock=/var/run/mysql/mysql.sock  --with-mcrypt=/usr/include --with-mhash --with-openssl --with-zlib --enable-zip --enable-mysqlnd --with-mysqli=shared,mysqlnd --with-pdo-mysql=shared,mysqlnd --with-gd --with-iconv --with-zlib --enable-zip --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-mbregex --enable-mbstring --enable-ftp --enable-gd-native-ttf --enable-pcntl --enable-sockets --with-xmlrpc --enable-soap --without-pear --with-gettext --enable-session --with-curl --with-jpeg-dir --with-freetype-dir --enable-opcache --enable-fpm  --with-fpm-user=apache --with-fpm-group=apache --without-gdbm --disable-fileinfo --with-bz2 --enable-maintainer-zts

    3.配置文件的服务控制脚本

      配置文件:

      cp /php.7/php.ini-production  /usr/local/php7/etc/php.ini

      cp /usr/local/php7/etc/php-fpm.conf.default  /usr/local/php7/etc/php-fpm.conf

      服务控制脚本:

      cp /php.7/sapi/fpm/init.d.php-fpm  /etc/rc.d/init.d/php-fpm && chown +x php-fpm

    4.设置php日志文件目录和运行ID文件目录,修改session目录配置

      mkdir -p /var/log/php-fpm/ && mkdir -p /var/run/php-fpm && cd /var/run/ && chown -R apache:apache php-fpm

      mkdir -p /var/lib/php/session

      chown -R apache:apache /var/lib/php

     5.加入环境变量

       vim /etc/profile.d/php7.sh

      export PATH=/usr/local/php7/bin:/usr/local/php7/sbin:$PATH

  • 相关阅读:
    Linux各主要发行版的包管理命令对照
    JDK 生成数字证书
    AbatorForEclipse插件使用总结
    [转载]在rhel 6 x86_64 上安装oracle 11g xe
    【转载】PL/SQL配置连接ORACLE
    Archlive新年第一棒: 基于2.6.37稳定内核的archlive20110107
    基于Arch的live系统
    【转】MyEclipse 9.0正式版官网下载(附Win+Llinux激活方法、汉化包)
    Exception in thread main java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFacto
    MyEclipse 8.6插件下载
  • 原文地址:https://www.cnblogs.com/yangxiaolan/p/4991119.html
Copyright © 2011-2022 走看看