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
至于具体什么含义大家自己去查吧,呵呵

posted @ 2012-12-27 15:15  春哥也编程  阅读(5949)  评论(0编辑  收藏  举报