php open_basedir

发布时间:2019-08-07 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了php open_basedir脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

在Mac的VMware下面配置了个虚拟机,php的集成开发环境使用的是lnmp,配置了pangu系统的虚拟机,提示如下错误:

Warning: require(): open_basedir restriction in effect. File(/mnt/hgfs/php/api/config.inc.php) is not within the allowed path(s): (pangu/:/tmp/) in /mnt/hgfs/php/index.php on line 25 Warning: require(/mnt/hgfs/php/api/config.inc.php): failed to open stream: Operation not permitted in /mnt/hgfs/php/index.php on line 25 Fatal error: require(): Failed opening required './api/config.inc.php' (include_path='.:') in /mnt/hgfs/php/index.php on line 25

后来查Google发现是open_basedir会阻止打开不在open_basedir里面指定目录的文件,只要在php.ini配置open_basedir,把要引入的文件路径加入即可

------------------------------------------
[HOST=www.lnmp.org]
open_basedir=ls/:/tmp/
[PATH=ls]
open_basedir=ls/:/tmp/
[HOST=128.com]
open_basedir=/home/wwwroot/128.com/:/tmp/
[PATH=/home/wwwroot/128.com]
open_basedir=/home/wwwroot/128.com/:/tmp/:/mnt/hgfs/

脚本宝典总结

以上是脚本宝典为你收集整理的php open_basedir全部内容,希望文章能够帮你解决php open_basedir所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: