【问题标题】:php obstacle when index page restarting Automatically索引页面自动重新启动时的php障碍
【发布时间】:2013-06-19 16:55:50
【问题描述】:

我有一个可以获取 YouTube 视频的脚本

$path_to_file = realpath('index.txt');
$videolink = @file_get_contents($path_to_file);


if(isset($videolink))
{
include('curl.php');
include('youtube.php');
$tube = new youtube();
$links = $tube->get($videolink);

但有时它不显示结果所以我做了这样的事情:

if(!$links) {
go back and try again

当脚本返回并重新启动时,php 会出现许多错误,例如“无法重新声明函数”和...

我能做什么?

如果您需要更多信息,请告诉我。

【问题讨论】:

标签: php restart


【解决方案1】:

可能是您的代码返回时。它再次包含 curls.php 和 youtube.php。在这种情况下,将include 替换为include_once 就足够了。

这个link 可能会对你有所帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多