mirror of
https://github.com/kmvan/x-prober.git
synced 2026-08-13 06:21:41 +08:00
[BUG] 宝塔面板环境无法显示磁盘容量 #9
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ghost on GitHub (Jan 28, 2019).
Originally assigned to: @kmvan on GitHub.
** 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
@kmvan commented on GitHub (Jan 28, 2019):
感谢反馈。
刘海探针当前是用
disk_total_space('/')来获取系统的磁盘空间信息,当宝塔设置了“防跨站”的选项后,会限制脚本访问路径范围,所以/根目录就无法显示。disk_total_space('.')相当于当前目录,或当前脚本所挂载的空间,这个方法我没想到过,你的方法很不错,下个版本会按照这个方法来显示,十分感谢!@kmvan commented on GitHub (Jan 28, 2019):
@qiukong 经测试,使用
__DIR__比.更具有效率,依然能获取空间使用情况。你可以试试看在宝塔中是否能起作用?@ghost commented on GitHub (Jan 28, 2019):
解决了,感谢!!