简体   繁体   English

Laravel exec()在排队的工作中

[英]Laravel exec() in queue'd job

I'm using a redis queue with my laravel app. 我在laravel应用中使用Redis队列。 It doesn't appear that calling exec('{run some java program}') from within my queue'd job actually executes that command. 从队列中的作业中调用exec('{run some java program}')似乎并没有真正执行该命令。

Anyone know anything about this? 有人知道这是什么一回事吗?

If there's an error with your external executable for whatever reason, PHP will skip past and ignore the output of exec (you may wish to debug / dump the result of exec() to a file / console to find out more) and therefore so will the queue. 如果您的外部可执行文件由于某种原因出现错误,PHP将会跳过并忽略exec的输出(您可能希望将exec()的结果调试/转储到文件/控制台中以了解更多信息),因此,队列。

Handy to remember, the PHP-CLI that Queues run in don't have access to anything you'd usually use in a non-CLI (PHP-FPM, Apache module etc...) environment (Request, request() and $request will not work as you expect them to ) 方便记住,运行Queues的PHP-CLI无法访问您通常在非CLI(PHP-FPM,Apache模块等)环境中使用的任何内容(Request,request()和$该请求将无法按您期望的那样工作)

Related: 有关:

Laravel Queued Job doesn't wait for exec to coplete Laravel排队作业不等待exec完成

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM