include_once被忽略

时间:2012-09-05 05:42:04

标签: php

好。

因此,在此脚本http://ideone.com/grapQ的第37行,include_once命令基本上被忽略,我尝试显示的内容根本没有显示,甚至没有显示错误消息。

我尝试启用错误报告,但没有显示任何一个错误。

我也尝试使用Echo,同样的问题仍然存在。

有没有人知道为什么会被忽略,甚至没有显示错误信息?运气不仅仅是它的基本功能!

3 个答案:

答案 0 :(得分:4)

您在该include语句的末尾缺少分号:

include_once('http://outside-resources.ultimatesphider.com/us-resources/2.0.1/2.0.1announce.php');

此外,当我在本地计算机上测试它(只是那条线)时,我收到以下错误:

Warning: include_once(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in /var/www/test.php on line 5 
Warning: include_once(http://outside-resources.ultimatesphider.com/us-resources/2.0.1/2.0.1announce.php): failed to open stream: no suitable wrapper could be found in /var/www/test.php on line 5 
Warning: include_once(): Failed opening 'http://outside-resources.ultimatesphider.com/us-resources/2.0.1/2.0.1announce.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/test.php on line 5 

Deepak的回答提供了有关允许可能适用于您的问题的外部文件的更多信息。

答案 1 :(得分:3)

您不能包含PHP 5.2.0及更高版本中的远程文件。如果您要使用远程URL 必须启用allow_url_include 。请参阅Link

答案 2 :(得分:0)