第一次在 ubuntu 15.10 下搭建 nginx php5 开发环境。没想到遇到各种问题。
主要在于在 通过apt-get intsall php 和nginx的后,发现不同操作系统下的配置文件是不完全一致的,ubuntu上的被打散了,而且配置项也有差异。
该系统下:
# Default server configuration
server {
listen 80 default_server;
listen [::]:80 default_server;
# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;
root /var/www/html; //这个写法有助于同时配置了apache和nginx的用户测试性能,因为站点根目录没有变,不需要再移动项目。当然,前提是apache的安装方式也是apt-get insall apache2 啦。
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name localhost;
location / {
# First attempt to serve request as file, then