Add the argc_argv flag for the cgi exec #553 (#556)

This commit is contained in:
Nabeel S 2020-02-18 17:01:00 -05:00 committed by GitHub
parent 8300a69ad5
commit 9304daea7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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',
];