php - mac下VM虚拟机装 centos 挂载mac 的盘做站点目录无法写入?
PHP中文网
PHP中文网 2017-04-11 08:59:44
[PHP讨论组]

正常PHPINFO() 访问可以,但是lnmp 用户无法写入
修改过lnmp 的启动用户为root 也不行
修改nginx.conf:
user www www; 修改为 user root root;,
使用 /usr/local/nginx/sbin/nginx -s reload

因为我的程序涉及到缓存写入操作的时候提示无法写入
在linux 挂载这端,也无法用chmod -R 777 修改目录权限

mac上共享 www目录,挂载到linux 的mnt下面
挂载方式:mount -t cifs //ServerName/ShareName /mnt/wwwroot -o username=ServerUsername,password=YourPassword,nounix,sec=ntlmssp

我参考的地址是
https://segmentfault.com/a/11...

然后安装 lnmp 环境 配置虚拟机
server

{
    listen 80;
    #listen [::]:80;
    server_name 172.16.186.132;
    index index.html index.htm index.php default.html default.htm default.php;
    root  /mnt/wwwroot/devweb;

    include other.conf;
    #error_page   404   /404.html;
    location ~ [^/]\.php(/|$)
    {
        # comment try_files $uri =404; to enable pathinfo
        try_files $uri =404;
        fastcgi_pass  unix:/tmp/php-cgi.sock;
        fastcgi_index index.php;
        include fastcgi.conf;
        #include pathinfo.conf;
    }

    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    {
        expires      30d;
    }

    location ~ .*\.(js|css)?$
    {
        expires      12h;
    }

    access_log  /home/wwwlogs/devweb.log  access;
}
PHP中文网
PHP中文网

认证0级讲师

全部回复(0)
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号