Can't use shell_exec for laravel artisan command in live server
For this error try to run the following commands:
php artisan clear-compiledphp artisan optimize
this should regenerate compiled.php
file.
As for executing artisan commands from within your code there are better ways than using shell_exec
- for example using Laravel build in support for programmatically executing commands
The error
% Cannot redeclare class %
also occurs when you inject a class that has the same name as the one you are actively editing/modifying.
In your case, please make sure that you have not injected a class with the name "Macroable" elsewhere. If you have, make sure that the namespace is unique.