Ubuntu中搭建Nginx、PHP环境最简单的方法

sudo apt-get install nginx php5-fpm

sudo gedit /etc/nginx/site-available/default

 

location ~ \.php$ {

# fastcgi_split_path_info ^(.+\.php)(/.+)$;

# # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini

#

# # With php5-cgi alone:

# fastcgi_pass 127.0.0.1:9000;

# # With php5-fpm:

 fastcgi_pass unix:/var/run/php5-fpm.sock;

 fastcgi_index index.php;

 include fastcgi_params;

}

 

 

sudo service nginx start

保存文件,使配置生效 /etc/init.d/nginx reload

 

index index.html index.htm index.php;

 

default文件中,在server{}指示符的 location / {} 指示符内,加入

autoindex on;

木易的技术记录 » Ubuntu中搭建Nginx、PHP环境最简单的方法

顶 (0)

评论 0

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

置顶文章