Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/240.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
php:像远程站点一样从本地php文件读取_Php_File_Load_Local - Fatal编程技术网

php:像远程站点一样从本地php文件读取

php:像远程站点一样从本地php文件读取,php,file,load,local,Php,File,Load,Local,我想让一个页面输出本地PHP文件的结果,但当试图通过file\u get\u contents执行此操作时,我遇到一个错误: file_get_contents(page.php?p=page1): failed to open stream: Result too large 我想在发送get变量p后获取page.php的内容,就像查看page时所显示的那样。php?p=page1通常file\u get\u contents正在尝试按照当前设置的方式读取本地文件系统 您需要给它一个完整的U

我想让一个页面输出本地PHP文件的结果,但当试图通过
file\u get\u contents
执行此操作时,我遇到一个错误:

file_get_contents(page.php?p=page1): failed to open stream: Result too large

我想在发送get变量p后获取page.php的内容,就像查看page时所显示的那样。php?p=page1通常

file\u get\u contents
正在尝试按照当前设置的方式读取本地文件系统

您需要给它一个完整的URL,如
http://yoursite.com/page.php?p=page1


请注意,必须启用此功能才能工作。

这很有意义,谢谢!有没有一种方法可以动态获取“”部分?我正在本地主机上写这篇文章,并计划在以后启动并运行时将其放到我的服务器上。当然<代码>$\u服务器['HTTP\u主机]。或者更具体地说:
“http://”$_服务器['HTTP_HOST']。“/page.php?p=page1”