From 9304daea7a5b1ba58e7a23a75ab802586301e378 Mon Sep 17 00:00:00 2001 From: Nabeel S Date: Tue, 18 Feb 2020 17:01:00 -0500 Subject: [PATCH] Add the argc_argv flag for the cgi exec #553 (#556) --- app/Services/CronService.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/Services/CronService.php b/app/Services/CronService.php index fd1c98fd..6e4f8104 100644 --- a/app/Services/CronService.php +++ b/app/Services/CronService.php @@ -29,11 +29,18 @@ class CronService extends Service { $finder = new PhpExecutableFinder(); $php_path = $finder->find(false); + $php_exec = str_replace('-fpm', '', $php_path); + + // If this is the cgi version of the exec, add this arg, otherwise there's + // an error with no arguments existing + if (str_contains($php_exec, '-cgi')) { + $php_exec .= ' -d register_argc_argv=On'; + } $path = [ 'cd '.base_path(), '&&', - str_replace('-fpm', '', $php_path), + $php_exec, 'artisan schedule:run', ];