如何解决带有symfony的主管:错误:超过30秒的最大执行时间
我正在尝试用symfony(php)收听监督事件。遵循以下示例:https://github.com/mtdowling/php-supervisor-event
但是,无论何时我转到相关路线,或从Web界面在http:// localhost:9001 /
下启动侦听器我遇到一个错误,笔记本电脑迷发疯了:
child 38608 said into stdout: "READY"
[Web Server/PHP ] Sep 21 16:40:25 |ERROR| PHP PHP Fatal error: Maximum execution time of 30 seconds exceeded in ...../vendor/mtdowling/supervisor-event/src/Mtdowling/Supervisor/EventListener.php on line 133
[Web Server/PHP ] Sep 21 16:40:25 |ERROR| PHP Uncaught PHP Exception Symfony\Component\ErrorHandler\Error\FatalError: "Error: Maximum execution time of 30 seconds exceeded" at ..../vendor/mtdowling/supervisor-event/src/Mtdowling/Supervisor/EventListener.php line 133
我的控制器:
<?php
namespace App\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
use Mtdowling\Supervisor\EventListener;
use Mtdowling\Supervisor\EventNotification;
if(!defined('STDIN')) define('STDIN',fopen('php://stdin','r'));
if(!defined('STDOUT')) define('STDOUT',fopen('php://stdout','w'));
if(!defined('STDERR')) define('STDERR',fopen('php://stderr','w'));
class EventController extends AbstractController
{
/**
* @Route("/api/listener",methods="GET",name="my_listener")
*/
public function listener()
{
$listener = new EventListener();
$listener->listen(function(EventListener $listener,EventNotification $event) {
$listener->log($event->getEventName());
$listener->log($event->getServer());
$listener->log($event->getPool());
$listener->log(var_export($event->getData(),true));
return true;
});
}
}
我的supervisor.conf相关部分:
[eventlistener:listener1]
command=wget "http://localhost:8000/api/listener"
events=PROCESS_STATE
stderr_logfile=/home/Data/test_processes/l1.err.log
stdout_logfile=/home/Data/test_processes/l1.out.log
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。