dongque3797 2014-09-20 13:25
浏览 44
已采纳

Nginx Php5-fpm配置无法在Maverisks上运行

I'm facing with a problem with nginx which took me a whole day. I tried many solutions found on the internet but no success. I installed nginx, mysql, php-fpm on MAC through homebrew. It's really easy to install. Everything works as expected except one thing. When every I try to get to my website, it return 404.

Here are the logs, the nginx configuration, the file system structure & privileges.

server {
charset utf-8;
client_max_body_size 128M;

listen 80; ## listen for ipv4
#listen [::]:80 default_server ipv6only=on; ## listen for ipv6

server_name emarketing.com www.emarketing.com;
root        /Users/summernguyen/Documents/workspace/e-marketing/web;
index       index.php;

access_log  /Users/summernguyen/Documents/workspace/e-marketing/runtime/logs/access.log;
error_log   /Users/summernguyen/Documents/workspace/e-marketing/runtime/logs/error.log debug;

location / {
    # Redirect everything that isn't a real file to index.php
    try_files $uri $uri/ /index.php?$args;
}

# uncomment to avoid processing of calls to non-existing static files by Yii
location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
    try_files $uri =404;
}
#error_page 404 /404.html;

location ~ \.php$ {
    include fastcgi.conf;
    fastcgi_pass   127.0.0.1:9000;
    #fastcgi_pass unix:/var/run/php5-fpm.sock;
    try_files $uri =404;
}

location ~ /\.(ht|svn|git) {
    deny all;
}

}

http://i.stack.imgur.com/gsuQt.png

http://i.stack.imgur.com/XKWAQ.png

Anyone has solved this kind of problem ? Please help me.

  • 写回答

1条回答 默认 最新

  • dqmhgz5848 2014-09-20 16:14
    关注

    I've had this problem before, it is - as the logs already said - a permissions problem. You have to make sure that every folder towards the root of your websites have execution permissions.

    You can do so by using chmod +x /path

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 宇视监控服务器无法登录
  • ¥15 PADS Logic 原理图
  • ¥15 PADS Logic 图标
  • ¥15 电脑和power bi环境都是英文如何将日期层次结构转换成英文
  • ¥15 DruidDataSource一直closing
  • ¥20 气象站点数据求取中~
  • ¥15 如何获取APP内弹出的网址链接
  • ¥15 wifi 图标不见了 不知道怎么办 上不了网 变成小地球了
  • ¥50 STM32单片机传感器读取错误
  • ¥50 power BI 从Mysql服务器导入数据,但连接进去后显示表无数据