[BUG] 宝塔面板环境无法显示磁盘容量 #9

Closed
opened 2026-01-15 11:33:51 +08:00 by yan · 3 comments
Owner

Originally created by @ghost on GitHub (Jan 28, 2019).

Originally assigned to: @kmvan on GitHub.

  • OS: CentOS7.6+宝塔面板6.8.8
  • PHP version: 7.3.1

** Report content **
我VPS使用的是CentOS7.6+宝塔面板6.8.8+PHP7.3.1,所有能升级的包括内核都是最新的,磁盘容量却无法显示。
但我自己写的探针用disk_total_space('.')和disk_free_space('.')函数可以轻易获取磁盘空间,没有这个问题。希望作者检查下,非常感谢!

你的探针:https://free3.astrolab.tk
我的探针:https://free3.astrolab.tk/status.php

Originally created by @ghost on GitHub (Jan 28, 2019). Originally assigned to: @kmvan on GitHub. - OS: CentOS7.6+宝塔面板6.8.8 - PHP version: 7.3.1 ** Report content ** 我VPS使用的是CentOS7.6+宝塔面板6.8.8+PHP7.3.1,所有能升级的包括内核都是最新的,磁盘容量却无法显示。 但我自己写的探针用disk_total_space('.')和disk_free_space('.')函数可以轻易获取磁盘空间,没有这个问题。希望作者检查下,非常感谢! 你的探针:[https://free3.astrolab.tk](https://free3.astrolab.tk) 我的探针:[https://free3.astrolab.tk/status.php](https://free3.astrolab.tk/status.php)
yan added the bug label 2026-01-15 11:33:51 +08:00
yan closed this issue 2026-01-15 11:33:52 +08:00
Author
Owner

@kmvan commented on GitHub (Jan 28, 2019):

感谢反馈。
刘海探针当前是用 disk_total_space('/') 来获取系统的磁盘空间信息,当宝塔设置了“防跨站”的选项后,会限制脚本访问路径范围,所以 / 根目录就无法显示。
disk_total_space('.') 相当于当前目录,或当前脚本所挂载的空间,这个方法我没想到过,你的方法很不错,下个版本会按照这个方法来显示,十分感谢!

@kmvan commented on GitHub (Jan 28, 2019): 感谢反馈。 刘海探针当前是用 `disk_total_space('/')` 来获取系统的磁盘空间信息,当宝塔设置了“防跨站”的选项后,会限制脚本访问路径范围,所以 `/` 根目录就无法显示。 `disk_total_space('.')` 相当于当前目录,或当前脚本所挂载的空间,这个方法我没想到过,你的方法很不错,下个版本会按照这个方法来显示,十分感谢!
Author
Owner

@kmvan commented on GitHub (Jan 28, 2019):

@qiukong 经测试,使用 __DIR__. 更具有效率,依然能获取空间使用情况。你可以试试看在宝塔中是否能起作用?

@kmvan commented on GitHub (Jan 28, 2019): @qiukong 经测试,使用 `__DIR__` 比 `.` 更具有效率,依然能获取空间使用情况。你可以试试看在宝塔中是否能起作用?
Author
Owner

@ghost commented on GitHub (Jan 28, 2019):

解决了,感谢!!

@ghost commented on GitHub (Jan 28, 2019): 解决了,感谢!!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: yan/archived-x-prober#9