【发布时间】:2014-05-21 14:59:01
【问题描述】:
- 我的开发环境是:Win7,XAMPP 1.8.3.3 VC11。
- 我的 PHP.ini 文件中的include_path 是:".;C:\xampp\php\PEAR"
我已经下载了一个包 simplehtmldom_1_5 并保存在“C:\xampp\php\PEAR”文件夹中,以便我的测试文件“C:\xampp\htdocs\test1.php”可以包含这个包中的 PHP 文件。我的 test1.php 看起来像:
<?php
include_once('simplehtmldom_1_5/simple_html_dom.php');
echo file_get_html('www.google.com')->plaintext;
?>
只要我输入http://localhost/test1.php,我就会收到以下错误:
Warning: file_get_contents(www.google.com): failed to open stream: No such file or directory in C:\xampp\php\pear\simplehtmldom_1_5\simple_html_dom.php on line 75
Notice: Trying to get property of non-object in C:\xampp\htdocs\test1.php on line 15
如果我将 simplehtmldom_1_5 包从“C:\xampp\php\PEAR”移动到“C:\xampp\htdocs\simplehtmldom_1_5”,然后尝试上面的 test1.php,我会收到以下错误:
Warning: file_get_contents(www.google.com): failed to open stream: No such file or directory in C:\xampp\htdocs\simplehtmldom_1_5\simple_html_dom.php on line 75
Notice: Trying to get property of non-object in C:\xampp\htdocs\test1.php on line 15
我花了相当多的时间来调试它,但现在放弃了。请帮助我哪里错了。
【问题讨论】:
标签: php apache xampp include-path