我正在尝试检索连接到我的服务器的 USB 硬盘上的可用空间(使用 php),但是 disk_free_space() 总是返回引导分区上的可用空间。这是我的服务器设置的摘要:
Rasbperry Pi 2 running rasbian.
php version: 5.4.39-0+deb7u2
booting from 32 gb sd card with about 24 gb free
3TB ntfs gpt usb hard drive mounted
ntfs-3g installed on system
测试代码:
<?
echo ":".disk_free_space("")."\n";
echo "/".disk_free_space("/")."\n";
echo "/mnt/drive:".disk_free_space("/mnt/drive")."\n";
?>
输出
PHP Warning: Module 'apc' already loaded in Unknown on line 0
PHP Warning: PHP Startup: apc.shm_size now uses M/G suffixes, please update your ini files in Unknown on line 0
PHP Warning: disk_free_space(): No such file or directory in /home/pi/test.php on line 2
:
/24991305728
/mnt/drive:24991305728