linuxソースインストールphp

1268 ワード

  • 対応バージョンのPHP php-5.6.36.tar.gz
  • をダウンロード
  • 解凍tar -zxvf php-5.6.36.tar.gz
  • configコマンド./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-mysql=mysqlnd --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-freetype-dir --with-png-dir --with-iconv-dir --with-zlib-dir --with-mcryp --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --disable-ipv6 --with-pear --with-curl --with-openssl
  • を実行する.
  • 誤報をyum -y install curl-devel ; yum install libxml2; yum install freetype-devel
  • に取り付ける
  • make make && make install
  • を実行する.
  • phpをコピーする.iniプロファイルから指定ディレクトリ
  • cp php.ini-development /usr/local/php/etc/php.ini  
    cd /usr/local/php/etc  
    cp ./php-fpm.conf.default ./php-fpm.conf
    
  • ソフトコネクションln -sf /usr/local/php/sbin/php-fpm /usr/bin/php
  • を設ける.
  • ユーザグループ
  • を設定する.
      php-fpm.conf  , user group   root
    
  • 起動
  •  cd /usr/local/php/sbin 
     ./php-fpm
    

    原文住所:https://blog.csdn.net/u013890624/article/details/80609565