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

  • 相关阅读:
    ubuntu中mysql版本升级到5.7
    ng-深度学习-课程笔记-5: 深层神经网络(Week4)
    ng-深度学习-课程笔记-4: 浅层神经网络(Week3)
    《计算机程式设计》Week6 课堂笔记
    《计算机程式设计》Week5 课堂笔记
    关于解决coursera视频缓冲问题
    《计算机程式设计》Week4 课堂笔记
    《计算机程式设计》Week3 课堂笔记
    《计算机程式设计》Week2 课堂笔记
    使用 Matlab 运行 Windows 命令
  • 原文地址:https://www.cnblogs.com/yangxiaolan/p/4991119.html
Copyright © 2011-2022 走看看