• PHP-5.3.27源码安装及nginx-fastcgi配置


    源码安装php

    cat /etc/redhat-release
    uname -rm
    wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
    yum install -y zlib-devel libxml2-devel libjpeg-turbo-devel 
    freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel 
    openssl-devel libmcrypt-devel
    mkdir /server/tools -p
    cd /server/tools
    wget https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz 或者 wget http://60.205.224.143/source/libiconv-1.15.tar.gz
    tar -xf libiconv-1.15.tar.gz
    cd libiconv-1.15
    ./configure --prefix=/usr/local/libiconv-1.15
    make 
    make install
    ln -s /usr/local/libiconv-1.15 /usr/local/libiconv
    rpm -qa zlib-devel libxml2-devel libjpeg-turbo-devel libmcrypt-devel 
    freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel openssl-devel
    cd ..
    wget http://mirrors.sohu.com/php/php-5.3.27.tar.gz
    tar xf php-5.3.27.tar.gz
    cd php-5.3.27
    
    ./configure 
    --prefix=/application/php-5.3.27 
    --with-mysql=mysqlnd 
    --with-iconv-dir=/usr/local/libiconv 
    --with-freetype-dir 
    --with-jpeg-dir 
    --with-png-dir 
    --with-zlib 
    --with-libxml-dir=/usr 
    --enable-xml 
    --disable-rpath 
    --enable-safe-mode 
    --enable-bcmath 
    --enable-shmop 
    --enable-sysvsem 
    --enable-inline-optimization 
    --with-curl 
    --with-curlwrappers 
    --enable-mbregex 
    --enable-fpm 
    --enable-mbstring 
    --with-mcrypt 
    --with-gd 
    --enable-gd-native-ttf 
    --with-openssl 
    --with-mhash 
    --enable-pcntl 
    --enable-sockets 
    --with-xmlrpc 
    --enable-zip 
    --enable-soap 
    --enable-short-tags 
    --enable-zend-multibyte 
    --enable-static 
    --with-xsl 
    --with-fpm-user=nginx 
    --with-fpm-group=nginx 
    --enable-ftp 
    
    #--with-mysql=mysqlnd  此参数表示使用php自带的mysql客户端
    
    make
    make install
    ln -s /application/php-5.3.27/ /application/php
    cp php.ini-production /application/php/lib/php.ini
    cd /application/php/etc/
    cp php-fpm.conf.default php-fpm.conf
    /application/php/sbin/php-fpm
    ps -ef | grep php-fpm
    lsof -i :9000
    

     配置nginx fastcgi模块

    vim /application/nginx/conf/extra/www.conf
    
    server {
            listen       80;
            server_name  www.peterwang.com;
            root html/www;
            index index.php index.html index.htm;
            error_page   500 502 503 504  /50x.html;
            access_log logs/access_www.log main;
            location / {
            
            }
            location ~.*.(php|php5)?$ {
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            include fastcgi.conf;
    	}
    }
    
    /application/nginx/sbin/nginx -t
    /application/nginx/sbin/nginx -s reload
    cd /application/nginx/html/www
    echo "<?php phpinfo(); ?>" > test_info.php
    cat test_info.php
    #打开浏览器,输入http://10.0.0.8/test_info.php
    
  • 相关阅读:
    邱洁红(帮别人名字作诗)
    为了你,我已等了一千年
    为什么才华横溢的人总是怀才不遇
    这三种力量,让你的人生从此大不一样……
    赠中华儿女
    管理的7重境界
    写下你人生101个不可思议的目标
    忙碌啊,请别带走我的诗魂
    宋彦澍(帮别人名字作诗)
    慈善家洛克菲勒先生的思想精华 自信与坚持
  • 原文地址:https://www.cnblogs.com/Peter2014/p/7512496.html
Copyright © 2020-2023  润新知