laravel-deployment | 追求质量的 Laravel 应用部署上线课程。 | Infrastructure Automation library
kandi X-RAY | laravel-deployment Summary
kandi X-RAY | laravel-deployment Summary
[WIP] 追求质量的 Laravel 应用部署上线课程。
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of laravel-deployment
laravel-deployment Key Features
laravel-deployment Examples and Code Snippets
Community Discussions
Trending Discussions on laravel-deployment
QUESTION
I am having an issue while I'm trying to deploy a Laravel application onto an Ubuntu Server with Capistrano.
My deployment directory is /var/www/project_stage. When I deploy my project to that directory, everything works just fine. My project becomes live, every single line of code works just as it should.
But when I make a change and deploy a new version of same project, somehow (I'm guessing) my files are getting cached and not responding with the newest release, they are still responding as the old version that alredy being overwritten.
When I deploy the project to a different folder (etc: /var/www/project_stage2 instead of /var/www/project_stage) and change my Nginx config to serve from that folder, it works as it should again. But not in the second deploy to same directory. So I can say that I can deploy to a different directory every time, but I cannot deploy to same directory twice. It always responses as first deploy.
Here's what I've tried:
- I checked whether the current directory of Capistrano is linked to correct folder, which it has.
- I checked whether the changes I made are visible on new deploy, which they are. Files are absolutely changed on new deploy.
- I checked whether Nginx is looking for correct release directory, it has.
- I tried to run
php artisan cache:clear
,route:clear
,view:clear
,config:cache
commands and I runcomposer dump-autoload
too. Nothing worked. - I changed Nginx's
sendfile
parameter tooff
and restarted, no result. - I read a similar issue on this question, but it didn't work on my case.
Here is my deploy.rb:
...ANSWER
Answered 2018-Jan-21 at 17:51The problem you are describing could occur if you are using OPcache with opcache.validate_timestamps
set to zero. With validate_timestamps set to zero, OPcache never checks for a newer version of the file. This improves performance slightly, but it means you will need to manually flush the cache.
There are two things you can do to resolve the issue:
- Set opcache.validate_timestamps to 1 in your php.ini. This will result in a small performance decrease.
- ...or flush the cache during your deployment, after the new files have been deployed, by calling
opcache_reset()
in a PHP script.
Note that because you are using php-fpm, you should be able to flush the cache from the cli. If you were using Apache with mod_php you would need to flush the cache in a script invoked by Apache (through an HTTP request) rather than from the cli. The cache must be flushed in the context that your application runs in.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install laravel-deployment
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page