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 關注
- 158 瀏覽
添加回答
舉報