php5.3编译

./configure --prefix=/usr/local/php/ --with-config-file-path=/usr/local/php/etc/  --with-libxml-dir=/usr/local/libxml2/ --with-jpeg-dir=/usr/local/jpeg/ --with-freetype-dir=/usr/local/freetype/ --with-gd=/usr/local/gd/ --with-mcrypt=/usr/local/libmcrypt/ --with-mysql=mysqlnd  --with-pdo-mysql=mysqlnd  --with-mysqli=mysqlnd --enable-fpm --with-fpm-user=webroot --with-fpm-group=webroot

nginx配置文件

 server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   /www;  #指定网站web目录
            index  index.html index.htm index.php;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /www;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ \.php$ {
            root  /www;  #指定网站web目录
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /www$fastcgi_script_name;   #指定网站web目录
            include        fastcgi_params;
        }

        
        //注:黑体www为web根目录,改成对应目录即可
        location 定义文件类型, \.php$ 代表所有以 php 作为文件后缀的文件类型.
        root 定义 php 文件存放的路径, 当前以 "/www" 作为默认存放位置.
        fastcgi_index 定义 php 文件类型中的默认索引页
        fastcgi_param SCRIPT_FILENAME 定义了页面请求参数, 如客户端需要访问 /t1.php 则会自动读取 /www/t1.php文件, 如客户端访问 / 则自动读取 /www/index.php 文件
        include 定义fastcgi 配置信息将会被保存到 /usr/local/nginx/conf/fastcgi_params 文件中


你可能感兴趣的:(php5.3编译)