【发布时间】:2015-04-10 15:21:47
【问题描述】:
我正在尝试像这样运行 phantomjs 脚本:
$max_time = ini_get('max_execution_time');
set_time_limit(0);
$result = shell_exec($path_to_phantomjs);
// Do stuff with result here...
set_time_limit($max_time);
这是一个抓取脚本,需要几分钟才能完成,但我想等待它的结果并在我的服务器上对其进行操作。对我来说,这个脚本将从客户端运行并返回一些结果以供分析等对我来说也很重要。
这会因 nginx 的 504 错误而失败,应该注意的是,相同的代码在我的(本地)apache 服务器上运行良好。
【问题讨论】:
标签: php linux nginx phantomjs server