Centos6.5 nginx+php-fpm

  • nginx

    wget http://nginx.org/download/nginx-1.6.0.tar.gz
    cd nginx-1.6.0
    ./configure --with-http_ssl_module
    make
    make install
    
  • php compile

    wget http://cn2.php.net/distributions/php-5.5.16.tar.gz
    tar zxvf php-5.5.16.tar.gz
    ./configure --prefix=/usr/local/php  --enable-fpm --with-mcrypt \
    --enable-mbstring --disable-pdo --with-curl --disable-debug  --disable-rpath \
    --enable-inline-optimization --with-bz2  --with-zlib --enable-sockets \
    --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex \
    --with-mhash --enable-zip --with-pcre-regex --with-mysql --with-mysqli \
    --with-gd --with-jpeg-dir
    

    configure: error: xml2-config not found. Please check your libxml2 installation.

    yum install -y libxml2-devel
    

    configure: error: Please reinstall the BZip2 distribution

    yum install -y bzip2-devel
    

    configure: error: jpeglib.h not found.

    yum install -y libjpeg-devel
    

    configure: error: png.h not found.

    yum install -y libpng-devel
    

    configure: error: mcrypt.h not found. Please reinstall libmcrypt.

    yum install -y libmcrypt-devel
    
    cp php.ini-production /usr/local/php/lib/php.ini
    vim /usr/local/php/lib/php.ini
    # cgi.fix_pathinfo=0
    
    cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
    vim /usr/local/php/etc/php-fpm.conf
    # listen = /var/run/php5-fpm.sock
    # listen.owner = www-data
    # listen.group = www-data
    # listen.mode = 0660
    
    ln -s /usr/local/php/bin/php /usr/bin/php
    ln -s /usr/local/php/sbin/php-fpm /usr/bin/php-fpm
    
  • php from yum

    rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
    rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
    yum --enablerepo=remi,remi-php55 nginx php-fpm php-common
    

你可能感兴趣的:(Centos6.5 nginx+php-fpm)