php – 检查open_basedir限制是否生效
发布时间:2020-12-13 13:23:30 所属栏目:PHP教程 来源:网络整理
导读:使用 PHPass( http://www.openwall.com/phpass/)时收到以下警告: open_basedir restriction in effect. File(/dev/urandom) is not within the allowed path(s) 虽然这不是一个大问题(它会落后于其他东西),但我不想发出这个警告. 程序应该在不同的服务器上
使用
PHPass(
http://www.openwall.com/phpass/)时收到以下警告:
open_basedir restriction in effect. File(/dev/urandom) is not within the allowed path(s) 虽然这不是一个大问题(它会落后于其他东西),但我不想发出这个警告. 程序应该在不同的服务器上运行,一些用户可以将该路径添加到其允许的open_basedir路径,但其他用户将无法访问该配置. 我的第一个猜测是用is_readable()检查可读性,但是,我仍然收到警告. 问题:如何检查某个路径或文件是否已添加到open_basedir路径?
您可以使用
ini_get() function读取PHP指令的值:
ini_get('open_basedir') 如果指令不为空,则它应包含由PATH_SEPARATOR分隔的a string with one ore more paths. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |