这里的编译环境使用lnmp1.3一键安装包,红色地方是需要注意的,这里只说明关于nginx的配置

vim /usr/local/nginx/conf/nginx.conf

增加一个虚拟主机

server

    {

    listen       80;

    server_name  www.linuxro.com;

    index       index.php index.html index.htm;

    root        /var/www/html/;

    #error_page   404   /404.html;

    #include enable-php.conf;

    include enable-php-pathinfo.conf;

    #location /nginx_status

    #    {

    #        stub_status on;

    #        access_log   off;

    #    }

    location / {

        if (!-e $request_filename) {

            rewrite  ^/(.*)$  /index.php/$1  last;

            break;

        }

    

    location ~ \\.php {

        fastcgi_pass 127.0.0.1:9000;

        fastcgi_index index.php;

        include fastcgi.conf;

        set $real_script_name $fastcgi_script_name;

        if ($fastcgi_script_name ~ "^(.+?\\.php)(/.+)$") {

            set $real_script_name $1;

            set $path_info $2;

        }

        fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;

        fastcgi_param SCRIPT_NAME $real_script_name;

        fastcgi_param PATH_INFO $path_info;

        }

    }