Troubleshooting is always running in Laravel 6 (PHP will make a fatal error due to duplicate definitions of functions)
1. Reference: In Linux and Laravel 6, the task queue is always running for troubleshooting and analysis (timeout time has been set):https://www.shuijingwanwq.com/2022/11/10/7139/. The previous reason was that the command line did not return 1 when Artisan::Call was executed, which caused the judgment to be invalid.
2. But after the solution, the task queue has been running again and again. Error: php fatal error: cannot redoclare settingURL() (previously declared in E:\WWRoot\Object\Modules\ThemeStoreDB\Resources\Set ting_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. as shown in 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 reason for PHP fatal error is that in the file contained in the include, due to the duplicate definition of the function, php will issue a fatal error (fatal error).
4. The final solution to the temporary solution is to modify the functions of the included files to different names to avoid this problem.
