gpt4 book ai didi

php - 检查open_basedir限制是否生效

转载 作者:可可西里 更新时间:2023-11-01 12:37:35 25 4
gpt4 key购买 nike

我在使用 PHPass ( http://www.openwall.com/phpass/ ) 时收到以下警告:

open_basedir restriction in effect. File(/dev/urandom) is not within the allowed path(s)

虽然这不是什么大问题(它会求助于其他东西),但我不希望有这个警告。 PHP 应用程序应该在不同的服务器上运行,一些用户将能够将该路径添加到他们允许的 open_basedir 路径,但其他人将无法访问该配置。

我的第一个猜测是使用 is_readable() 检查可读性,但是,我仍然收到警告。

问题:如何检查某个路径或文件是否已添加到 open_basedir 路径?

最佳答案

您可以使用 ini_get() function 读取 PHP 指令的值:

ini_get('open_basedir')

如果指令不为空,它应该包含 a string with one ore more pathsPATH_SEPARATOR 分隔。

关于php - 检查open_basedir限制是否生效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21427211/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com