VM 虚拟机, linux mount windows的共享目录,php报错:Fatal error: Unknown: Failed opening required...

春哥也编程很久没来了,最近在阿里的特别忙
但是在平时的工作中遇到了一个问题,想在这里跟大家一起分享一下

问题描述:

我有一台虚拟机,VM的,运行了centos6.3
想通过mountwindows的共享目录,运行php脚本

mount -t cifs //10.12.1.195/kiss /var/www/ -o username="xxx",password="xxx"

但是nginx总是报错,file not found.
然后插到php的原因,php-fpm运行正常的
知道用cli方式的运行php脚本的时候,才发现问题,
它就会报错

Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0

Fatal error: Unknown: Failed opening required 'xxx' in Unknown on line 0

命名可以打开,但是为什么会报错呢,反复的找问题,反复的想,没有问题啊,后来觉得是php的问题
所以在php的官网上查询到了一个bug
https://bugs.php.net/bug.php?id=48778

他里面形容的情况跟我遇到的一样,
尤其是看到下面的 [2010-10-20 09:37 UTC] sarunas dot valaskevicius at oxid-esales dot com 回答的内容

we faced similar problem on linux, while mounting windows dir, which seems to be 
the same problem as bug#50150.

Also, the workaround to add parameter "-o noserverino" while mounting worked ok 
(maybe for windows there is a similar mounting feature?).


所以得在mount的时候加上这个参数 noserverino
mount -t cifs //10.12.1.195/kiss /var/www/ -o username="xxx",password="xxx",noserverino
至于具体什么含义大家自己去查吧,呵呵

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值