T.S*_*.S. 8 php open-basedir phpass
使用PHPass(http://www.openwall.com/phpass/)时收到以下警告:
open_basedir restriction in effect. File(/dev/urandom) is not within the allowed path(s)
Run Code Online (Sandbox Code Playgroud)
虽然这不是一个大问题(它会落后于其他东西),但我不想发出这个警告.PHP应用程序应该在不同的服务器上运行,一些用户可以将该路径添加到其允许的open_basedir路径,但其他用户将无法访问该配置.
我的第一个猜测是检查可读性is_readable(),但是,我仍然收到警告.
问题:如何检查某个路径或文件是否已添加到open_basedir路径?
ini_get()您可以使用以下函数读取 PHP 指令的值:
ini_get('open_basedir')
Run Code Online (Sandbox Code Playgroud)
如果指令不为空,则它应该包含一个字符串,其中包含一个或多个由 分隔的路径PATH_SEPARATOR。