1 回答

TA贡献1813条经验 获得超2个赞
当您访问网络(smb 或 samba)文件时,这似乎是 php 中一个已知的错误。
已经问过类似的问题:is_writable 为 NFS-share 返回 false,即使它对用户 www-data 是可写的
阅读此内容以获取有关该错误的更多信息:https ://bugs.php.net/bug.php?id=68926
不幸的是,这个问题的唯一解决方案(据我所知)是编写您自己的自定义is_writeable
函数,如下所示:
<?php
namespace Same\As\One\You\Use\Them\In;
function is_readable($file)
{
if(file_exists($file) && is_file($file))
{
$f = @fopen($file, 'rb');
if(fclose($f))
{
return true;
}
}
return false;
}
function is_writable($file)
{
$result = false;
if(file_exists($file) && is_file($file))
{
$f = @fopen($file, 'ab');
if(fclose($f))
{
return true;
}
}
return false;
}
?>
- 1 回答
- 0 关注
- 168 浏览
添加回答
举报