I am using laravel 5.1 in my production server. After update my composer, queue listener command starts throwing error as
PHP Fatal error: Cannot redeclare class Illuminate\Support\Traits\Macroable in /var/www/<site-folder>/bootstrap/cache/compiled.php on line 6109
I couldn't find out the problem. My site is working fine, and other artisan commands are working fine. But I can't run my queue. Please suggest me some sollution
You should run Run
php artisan clear-compiled
php artisan optimize
and make you sure you restart your queue.
Related
After lunching the command php artisan optimize , i got
fatal error: Uncaught ReflectionException: Class "env" does not exist
I have tried deleting the bootstrap/cache/ and runing composer update but nothing works,
everytime i tried to run a php artisan command/composer command i got the same problem. am really stuck. any help.
You can clear cache using:
php artisan optimize:clear
Or only clear config cache using:
php artisan config:clear
https://dev.to/kenfai/laravel-artisan-cache-commands-explained-41e1
Maybe you have something wrong in your config/database.php file. If it is the case when you run composer update the console will show some error at the end of execution due the config/database.php file
I try to host my Laravel application in BlueHost i follow this tutorial LINK
i installed composer succesfully when i create new project in last line im getting this error
i tried php artisan command but its showing same error. can any one help on this Thank You.
This is how i solved my problem after the installation i used
php-cli artisan clear-compiled insted of php artisan clear-compiled
and we can use artisan command like this php-cli artisan ......
When I send a job that fails due to an exception such as 'ErrorException' with message 'Undefined variable: sender' and I fix the code and re-fire the event, the previous code runs again and I get the same error.
I have no idea why Laravel re-runs my old code over and over. I'd obviously like to be able to fix the mistakes that are breaking my job execution.
I've tried both composer dump-autoload and php artisan queue:flush and those have no effect. Any help?
My Laravel 5.1 config/compile.php file is empty but this helped me:
sudo service beanstalkd restart
and
php artisan queue:restart
Laravel often lacks of good and accurate documentation.
You need to run php artisan clear-compiled to clear compiled files.
If you look at config/compile.php you will see some extra providers (or other classes) are cached by default by Laravel.
If you made any changes for example in EventServiceProvider and it was earlier cached, Laravel won't see those changes in case php artisan optimize command was earlier launched (and looking at https://github.com/laravel/laravel/blob/master/composer.json you will see it is launched after running composer install or composer update).
This feature has nothing in common with composer itself but with Laravel that's why running composer dump-autoload won't help.
In my case, supervisor was the issue.
This is the only process that works consistently for me:
run 'service supervisor stop'
run 'service supervisor start'
quit your browser, restart it, clear the cache and try again
Note: running 'service supervisor restart' had no effect.
I'm using Lumen and ran into the same issue. I tried php artisan queue:restart, which did nothing. I then found this thread and tried php artisan clear-compiled, as per the winning answer, but got the error:
Command "clear-compiled" is not defined.
I then saw that Artisan had the option php artisan cache:clear, which did the trick! When I fire that command followed by php artisan queue:work, my new job code is used.
for a Laravel 5.1 project I am trying to setup a beta version of this project on a shared hoster. Everything works fine except for artisan.
I do login through ssh and move to the Laravel project directory and the not matter what php artisan command I use I get following error:
PHP Fatal error: Class 'Illuminate\Queue\ConsoleServiceProvider' not found in /www/htdocs///vendor/laravel/framework/src/Illuminate/Foundation/Application.php on line 543
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Illuminate\Queue\ConsoleServiceProvider' not found
Any ideas on what could be wrong?
The autoloading should work correctly as the project works fine using the browser.
The steps by #manix helped me a lot:
Delete file bootstrap/cache/services.json
call composer update
run php artisan optimize
I've got a brand new laravel installation on DigitalOcean, which I'm attempting to run a basic `composer update' on. However, I'm seeing the following error come up every time I try to update. I can't solve the problem with composer cacheclear, deleting the vendor/compiled.php file, or even reinstalling the entire framework.
I don't understand exactly what the error is in the first place, so I'm a bit lost. Any tips on what's going on?
Script php artisan clear-compiled handling the post-update-cmd event returned with an error
[RuntimeException]
Error Output: PHP Fatal error: Call to undefined method Illuminate\Foundat
ion\Application::getCachedCompilePath() in /var/www/html/production/vendor/
laravel/framework/src/Illuminate/Foundation/Console/ClearCompiledCommand.ph
p on line 28
Delete the vendor/compiled.php and run composer update.
Source: https://laracasts.com/discuss/channels/general-discussion/runtimeexception-on-fresh-install?page=1