When I deployed my Laravel 4.2.9 application to a Ubuntu 14.04 server using Capistrano, it seems like all my php files are being cached by PHP, Laravel or Nginx. I have to manually restart the server to bust the cache and see any of my changes.
Capistrano creates a new release directory on the server and runs a git checkout
inside to get te last tagged version. When the deploy has been completed, the 'current' symlink will be updated to point to the the new release directory. The only shared files are my uploads directory and my environment settings file.
Things I've tried:
php artisan cache:clear
composer dump-autoload
Only a manual server restart after deployment will bust the cache, which comes with a downtime (also for other sites hosted on that server) and extra risks.
Anyone have a suggestion whether this could be Nginx, PHP or Laravel itself?
I was having a similar problem when deploying my Laravel 5 application and seem to have solved it by adding the following to the end of Capistrano's deploy.rb:
(If you aren't using TwigBridge, be sure to remove the
twig:clean
line.)Edited to include the
clear-compiled
andview:clear
lines, as these seem to solve additional problems with deploying Laravel applications using Capistrano.