连续的phantomjs调用失败

时间:2017-04-15 13:05:02

标签: php phantomjs

我使用exec()从php连续多次调用phantomjs,但只有第一次调用被执行,第二次调用被卡住并且永远运行。我在脚本中有phantom.exit(1);。任务管理器中有一个phantomjs实例,netbeans调试器暂停。

    public static function render_tweet($tweet_url)
    {
        $selector = "[class='permalink-inner permalink-tweet-container']";
        $file = storage_path('temp\tweet1.png');  
        $script = app_path('MyApp\render_element_procedure.js');
        $phantom = base_path('bin\phantomjs.exe');


        $exec_str = sprintf('"%s" "%s" "%s" "%s" "%s"', $phantom, $script, $tweet_url, $selector, $file);
        $resp = exec($exec_str);
        return $file;
    }

0 个答案:

没有答案