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

    添加用户

    useradd -r -s /sbin/nologin php-fpm

    下载解压安装包

    cd /data/pkg
    wget http://php.net/get/php-7.2.2.tar.gz/from/this/mirror 
    mv mirror php-7.2.2.tar.gz
    tar zxvf php-7.2.2.tar.gz
    cd php-7.2.2

    安装依赖

    yum -y install libxml2 libxml2-devel openssl openssl-devel curl-devel libjpeg-devel libpng-devel freetype-devel libmcrypt-devel libxslt libicu-devel libxslt-devel

    编译安装

    ./configure 
    --prefix=/usr/local/php-7.2.2 
    --with-mhash 
    --with-openssl 
    --with-config-file-path=/usr/local/php-7.2.2/etc 
    --disable-short-tags 
    --enable-fpm 
    --with-fpm-user=php-fpm --with-fpm-group=php-fpm 
    --enable-xml 
    --with-libxml-dir 
    --enable-bcmath 
    --enable-calendar 
    --enable-intl 
    --enable-mbstring 
    --enable-pcntl 
    --enable-shmop 
    --enable-soap 
    --enable-sockets 
    --enable-zip 
    --enable-mbregex 
    --enable-mysqlnd 
    --enable-mysqlnd-compression-support 
    --with-mysqli=mysqlnd 
    --with-pdo-mysql=mysqlnd 
    --with-gd 
    --enable-ftp 
    --with-curl 
    --with-xsl 
    --with-iconv 
    --with-freetype-dir 
    --with-jpeg-dir 
    --with-png-dir 
    --with-zlib 
    --enable-sysvsem 
    --enable-inline-optimization 
    --with-xmlrpc 
    --with-gettext
    make -j 4 && make install

    建立软链

    ln -s /usr/local/php-7.2.2/ /usr/local/php
    ln -s /usr/local/php/bin/php /usr/local/bin
    ln -s /usr/local/php/sbin/php-fpm /usr/local/sbin

    对php-fpm运行用户进行设置

    cd /data/pkg/php-7.2.2
    cp ./php.ini-development ./php.ini-production /usr/local/php/etc
    cp /usr/local/php/etc/php.ini-development /usr/local/php/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

    建立软链

    ln -s /usr/local/php/etc/php.ini /usr/local/etc/
    ln -s /usr/local/php/etc/php-fpm.conf /usr/local/etc/
    ln -s /usr/local/php/etc/php-fpm.d/www.conf /usr/local/etc/

    配置环境变量,加入全局命令

    vim /etc/profile
    PATH=$PATH:/usr/local/php/bin
    export PATH
    source /etc/profile

    启动php-fpm 服务

    /usr/local/sbin/php-fpm

    查看是否启动

    netstat -lnt | grep 9000

    杀死php-fpm

    killall php-fpm

     

  • 相关阅读:
    [LeetCode]2. Add Two Numbers链表相加
    Integration between Dynamics 365 and Dynamics 365 Finance and Operation
    向视图列添加自定义图标和提示信息 -- PowerApps / Dynamics365
    Update the Power Apps portals solution
    Migrate portal configuration
    Use variable to setup related components visible
    Loyalty management on Retail of Dynamic 365
    Modern Fluent UI controls in Power Apps
    Change screen size and orientation of a canvas app in Power App
    Communication Plan for Power Platform
  • 原文地址:https://www.cnblogs.com/niuben/p/11418916.html
Copyright © 2011-2022 走看看