1. Reference: Troubleshooting analysis of a Laravel 6 job queue stuck in a running state on Linux (timeout already set). The previous cause was that executing Artisan::call did not return 1 from the command line, which led to the condition check failing.
2. However, after resolving that, the job queue got stuck in a running state once again. The error reported was: PHP Fatal error: Cannot redeclare settingUrl() (previously declared in E:\wwwroot\object\Modules\ThemeStoreDB\Resources\setting_migrations\v2.0.23\migrate_settings_data.php:31) in E:\wwwroot\object\Modules\ThemeStoreDB\Resources\setting_migrations\v2.0.23\migrate_cart.php on line 40. See Figure 1.

[2022-11-09 16:25:33][x4FpSm3puIKqXniqIAPDSVClo3G8QLNm] Processing: Modules\ThemeStoreDB\Jobs\ThemeInstallationJob
PHP Fatal error: Cannot redeclare settingUrl() (previously declared in E:\wwwroot\object\Modules\ThemeStoreDB\Resources\setting_migrations\v2.0.23\migrate_settings_data.php:31) in E:\wwwroot\object\Modules\ThemeStoreDB\Resources\setting_migrations\v2.0.23\migrate_cart.php on line 40
Symfony\Component\Debug\Exception\FatalErrorException : Cannot redeclare settingUrl() (previously declared in E:\wwwroot\object\Modules\ThemeStoreDB\Resources\setting_migrations\v2.0.23\migrate_settings_data.php:31)
at E:\wwwroot\object\Modules\ThemeStoreDB\Resources\setting_migrations\v2.0.23\migrate_cart.php:40
36| }
37| }
38| }
39|
> 40| function settingUrl($url)
41| {
42| if (is_null($url)) {
43| return null;
44| }
Whoops\Exception\ErrorException : Cannot redeclare settingUrl() (previously declared in E:\wwwroot\object\Modules\ThemeStoreDB\Resources\setting_migrations\v2.0.23\migrate_settings_data.php:31)
at E:\wwwroot\object\Modules\ThemeStoreDB\Resources\setting_migrations\v2.0.23\migrate_cart.php:40
36| }
37| }
38| }
39|
> 40| function settingUrl($url)
41| {
42| if (is_null($url)) {
43| return null;
44| }
Exception trace:
1 Whoops\Run::handleError("Cannot redeclare settingUrl() (previously declared in E:\wwwroot\object\Modules\ThemeStoreDB\Resources\setting_migrations\v2.0.23\migrate_settings_data.php:31)", "E:\wwwroot\object\Modules\ThemeStoreDB\Resources\setting_migrations\v2.0.23\migrate_cart.php")
E:\wwwroot\object\vendor\filp\whoops\src\Whoops\Run.php:486
2 Whoops\Run::handleShutdown()
[internal]:0
3. The cause of the PHP Fatal error is that within the files included via include, a function is defined more than once, which causes PHP to emit a fatal error.
4. The final temporary workaround is to rename the duplicate functions in the included files to different names to avoid this issue.
