开发者

Permission denied with nginx and php

  • I have create under my nginx webdir a ln -s (symbolic link) to a directory in my homedir
  • I now try to read it from a PHP script but get:

Warning: opendir(/usr/local/n/test): failed to open dir: Permission denied in /usr/local/n

  • I have set no open base dir in php.ini
  • directory and files are having a group in which the web user is part of
  • both nginx and php fpm run under that same user

How can I fix 开发者_如何学Gothis?


The only solution to this was to copy the files. I wasn't able to get nginx to read symbolically linked files.

I've seen recommendations that the files under the main 'public' or 'html' directory can be followed, but this was not the case for me.


I remember there is option in php or nginx(apache) to allow symbolic link, you need to check that. you could search google : nginx and php using symbolic link I couldn't remember that option exactly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜