对 PHP 的 is_readable() 函数的调用在可从命令提示符读取的目录上返回 false。我已将权限更改为最允许的,但仍然没有运气。
ls -lad /remote/samba_share
drwxrwxr-x 13 me users 0 May 29 15:49 /remote/samba_share
ls -la /remote/samba_share
drwxr-xr-x 4 me users 0 May 8 14:19 /remote/samba_share/local_dir
drwxr-xr-x 16 me users 0 May 14 19:49 /remote/samba_share/second_drive
drwxrwxrwx 12 me users 0 May 30 09:42 /remote/samba_share/ext_raid
运行以下代码...
if (is_readable('/remote/samba_share' )){ echo "share ok\n"; } else { echo "share BAD\n"; }
if (is_readable('/remote/samba_share/local_dir' )){ echo "local ok\n"; } else { echo "local BAD\n"; }
if (is_readable('/remote/samba_share/second_drive' )){ echo "second ok\n"; } else { echo "second BAD\n"; }
if (is_readable('/remote/samba_share/ext_raid' )){ echo "raid ok\n"; } else { echo "raid BAD\n"; }
...结果是...
share ok
local ok
second BAD
raid BAD
samba 共享下不在物理主分区上的任何目录似乎都失败了。
调用 is_readable() 的机器的配置详细信息:
php -v
PHP 5.3.11-pl0-gentoo (cli) (built: May 5 2012 16:48:35)
php.ini:
safe_mode = Off
safe_mode_gid = On # (tried either way, shouldn't matter)
;open_basedir =
/etc/fstab entry:
//remote_machine/samba_share /remote/samba_share cifs iocharset=utf8,credentials=/blahblah/samba_credentials,uid=me,gid=users,file_mode=0777,dir_mode=0777,auto 0 0
eix samba
[I] net-fs/samba
Installed versions: 3.5.15!t
远程机器的配置细节:
eix samba
[I] net-fs/samba
Installed versions: 3.5.15!t
/etc/samba/smb.conf:
[samba_share]
path = /samba_share/
public = yes
writable = yes
; printable = yes
browseable = yes
create mask = 0777
create mode = 0777
directory mode = 0777
我已经尝试了我能想到的一切来让这个工作,现在我觉得很愚蠢。:-) 如果这似乎与任何人相关,我也可以提供内核配置。谢谢你的帮助!