從http://carl830.pixnet.net/blog/post/63576511做了點修改

apt-get install nginx php5-cli php5-cgi spawn-fcgi psmisc

接著在/etc/nginx/sites-available/ 底下會有個default

直接來修改這個檔案

server {
        listen   80 default;
        server_name  localhost;

        access_log  /var/log/nginx/localhost.access.log;

        location / {
                root   /var/www/nginx-default;
                index   index.php;
        }
        location /phpmyadmin {
          root /usr/share;
          index index.php;
        }
        location ~ \.php$ {
                set $php_root   /var/www/nginx-default;
                if ($request_uri ~* /phpmyadmin) {
                        set $php_root /usr/share;
                }
                fastcgi_pass 127.0.0.1;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  $php_root$fastcgi_script_name;
                include /etc/nginx/fastcgi_params;
        }
}

修改完後來安裝php-fpm

不過我用10.04LTS是找不到這個套件的

所以一開始就要加入某個來源

sudo aptitude install python-software-properties
sudo add-apt-repository ppa:brianmercer/php
sudo aptitude -y update

接著安裝~

sudo aptitude -y install php5-fpm

最後啟動service就ok了~

sudo service php5-fpm start
sudo service nginx start

另外有些在參考網頁裡還有加上一些設定 我覺得應該不需要修改也可以work 試試看唄

 

參考網頁:

http://gerardmcgarry.com/blog/how-install-php-fpm-nginx-ubuntu-1004-server

arrow
arrow
    文章標籤
    linux nginx ubuntu
    全站熱搜

    卡卡 發表在 痞客邦 留言(0) 人氣()