Ubuntu 10.10 安装mysql,nginx,php

先装nginx:
sudo apt-get install nginx
再装PHP及一些组件:
sudo apt-get install php5-cgi php5-mysql php5-fpm php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
修改nginx配置文件:
sudo gedit /etc/nginx/sites-available/default,内容如下



server {
        listen   80;
        server_name  localhost;
        root   /var/www/;


        location / {
                index  index.php index.html index.htm;
        }

        location ~ .php$ {

                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                include        fastcgi_params;
        }

        location ~ /.ht {
                deny  all;
        }
}

修改 /etc/nginx/fastcgi_params,最后增加:


fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
fastcgi_param  PATH_INFO          $fastcgi_script_name;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;

最后重启生效
sudo /etc/init.d/nginx restart
sudo /etc/init.d/php5-fpm restart
现在下个PHP探针放/var/www目录下试试看吧

© 2010, 冰冻鱼. 请尊重作者劳动成果,复制转载保留本站链接! 应用开发笔记