我正在使用我的网站中包含的php页面,它在localhost中完美地工作而没有错误,但在使用实时Web服务器运行时它显示错误。
使用这些功能
include("http-url/file.php")
和required_once("http-url/file.php")
他们显示这样的错误
警告:include():http://在服务器中禁用了包装器 配置by allow_url_include = 0 in www.mysite.com / .... 与文件包含......... 该怎么做才能解决这个问题
答案 0 :(得分:1)
许多开发人员通过指向远程URL来包含文件,即使该文件位于本地系统中也是如此。例如:
<?php include("http://example.com/includes/example_include.php"); ?>
禁用allow_url_include后,此方法不起作用。相反,该文件必须包含在本地路径中,并且有三种方法可以执行此操作:
示例包含
<?php include($_SERVER['DOCUMENT_ROOT']."/includes/example_include.php"); ?>
有关 allow_url_include here
的更多信息