本文共 1959 字,大约阅读时间需要 6 分钟。
以下设置与预期一样有效.最终,CIFS主机脱机(补丁,电源等).当发生这种情况时……尽管操作系统完全可以访问CIFS共享,但
PHP似乎会失去理智并拒绝访问挂载点中的文件,直到重新启动php-fpm.
Warning: scandir(repository/Some Series/Some Title): failed to open dir: No such file or directory in /var/www/audiobooks/libraries/bookScan.php on line 169
关于我缺少的任何指针,以便不需要php-fpm重启?
我在linux服务器上有以下挂载点:
//10.68.x.x/Media/Audiobooks on /var/www/audiobooks/repository type cifs (rw,relatime,vers=default,cache=strict,username=xxxxxx,domain=/,uid=48,forceuid,gid=996,forcegid,addr=10.68.x.x,file_mode=0755,dir_mode=0775,soft,nounix,mapposix,rsize=1048576,wsize=1048576,echo_interval=60,actimeo=1)
运行以下代码:
public function getBookFiles($book)
{
$path = $book["path"];
$files = scandir($path);
$files = array_diff($files,array('..','.'));
return $files;
}
补充说明:
PHP-FPM重启修复了该问题.操作系统在中断期间访问这些文件没有问题.
[root@audiobook audiobooks]# stat /var/www/audiobooks/repository/Some\ Series/Some\ Title/01\ Some\ Title.mp3
File: '/var/www/audiobooks/repository/Some Series/Some Title/01 Some Title.mp3'
Size: 4170169 Blocks: 8152 IO Block: 16384 regular file
Device: 77h/119d Inode: 179 Links: 1
Access: (0555/-r-xr-xr-x) Uid: ( 48/ apache) Gid: ( 996/ nginx)
Access: 2018-03-31 17:09:58.810843700 +0000
Modify: 2018-03-21 20:33:16.000000000 +0000
Change: 2018-04-01 05:58:06.448224400 +0000
Birth: -
PHP版本:
php72-php.x86_64 7.2.4-1.el7.remi @remi-safe
php72-php-cli.x86_64 7.2.4-1.el7.remi @remi-safe
php72-php-common.x86_64 7.2.4-1.el7.remi @remi-safe
php72-php-fpm.x86_64 7.2.4-1.el7.remi @remi-safe
php72-php-json.x86_64 7.2.4-1.el7.remi @remi-safe
php72-php-mbstring.x86_64 7.2.4-1.el7.remi @remi-safe
php72-php-pdo.x86_64 7.2.4-1.el7.remi @remi-safe
php72-php-pecl-http.x86_64 3.1.1~RC1-2.el7.remi @remi-safe
php72-php-pecl-propro.x86_64 2.0.1-4.el7.remi @remi-safe
php72-php-pecl-raphf.x86_64 2.0.0-5.el7.remi @remi-safe
php72-php-pecl-zip.x86_64 1.15.2-1.el7.remi @remi-safe
php72-php-xml.x86_64 7.2.4-1.el7.remi @remi-safe
php72-runtime.x86_64 1.0-1.el7.remi @remi-safe
转载地址:http://smggp.baihongyu.com/