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 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化