我在vmware虚拟机上使用ubuntu来testing我的php项目。 我在那里安装了nginx,php7.0-fpm,mysql。
我的共享位于Windows 10上,并使用cif和fstab挂载到虚拟机:
//192.168.100.1/projects /mnt/projects cifs credentials=/home/magic/.smbcredentials,cache=none,file_mode=0777,dir_mode=0777,noperm,rsize=16384,wsize=16384,noacl,sec=ntlm,nobrl 0 0
它大部分时间都很好用。 但是在大项目中,需要读取许多文件进行编译,在PHP脚本生命期间出现input/输出错误:
Warning: include(/mnt/projects/magento2/magento2/vendor/magento/framework/Component/ComponentRegistrarInterface.php): failed to open stream: Input/output error in /mnt/projects/magento2/magento2/vendor/composer/ClassLoader.php on line 444
每次链接到随机文件的错误。 当有多个请求到达php-fpm时,通常会发生问题。 例如
当没有并发的PHP请求时,问题不会发生。 所以当只有一个请求 – PHP成功完成编译工作。 (不经常,但在单个请求中也发生错误)
它performance得像来自networking层面的错误。 当检测到新的文件读取请求时,会导致文件读取过程中断。
我正在挖掘sambaconfiguration,cifsconfiguration。 升级到最新版本的cifs-utils和samba。 但还没有成功。
所有我能做的只是将php fpm进程限制为1.哪一个不是很好的决定,因为即使有一个孩子 – 错误也会发生一些。
有没有办法找出是什么原因或解决这个问题?