Chapters
24 Chapters
|
2:45:42
|
Login to bookmark this video
-
Course Code
Subscribe to download the code!Compatible PHP versions: >=5.5.9
Subscribe to download the code!Compatible PHP versions: >=5.5.9
-
This Video
Subscribe to download the video!
Subscribe to download the video!
-
Subtitles
Subscribe to download the subtitles!
Subscribe to download the subtitles!
-
Course Script
Subscribe to download the script!
Subscribe to download the script!
14.
Faster Deploy with Shared Files
Scroll down to the script below, click on any sentence (including terminal blocks) to jump to that spot in the video!
Subscribe to jump to this part in the video!
Keep on Learning!
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
While the fundamentals of Ansistrano haven't changed, this tutorial is built using Symfony 3, which has significant differences versus Symfony 4 and later.
What PHP libraries does this tutorial use?
// composer.json
{
"require": {
"php": ">=5.5.9",
"doctrine/doctrine-bundle": "^1.6", // 1.6.8
"doctrine/orm": "^2.5", // v2.7.2
"incenteev/composer-parameter-handler": "^2.0", // v2.1.2
"sensio/distribution-bundle": "^5.0.19", // v5.0.20
"sensio/framework-extra-bundle": "^3.0.2", // v3.0.26
"symfony/monolog-bundle": "^3.1.0", // v3.1.0
"symfony/polyfill-apcu": "^1.0", // v1.4.0
"symfony/swiftmailer-bundle": "^2.3.10", // v2.6.3
"symfony/symfony": "3.3.*", // v3.3.5
"twig/twig": "^1.0||^2.0", // v1.34.4
"doctrine/doctrine-migrations-bundle": "^1.2", // v1.2.1
"predis/predis": "^1.1", // v1.1.1
"composer/package-versions-deprecated": "^1.11" // 1.11.99
},
"require-dev": {
"sensio/generator-bundle": "^3.0", // v3.1.6
"symfony/phpunit-bridge": "^3.0", // v3.3.5
"doctrine/data-fixtures": "^1.1", // 1.3.3
"hautelook/alice-bundle": "^1.3" // v1.4.1
}
}
What Ansible libraries does this tutorial use?
# ansible/requirements.yml
-
src: DavidWittman.redis
version: 1.2.4
-
src: ansistrano.deploy
version: 2.7.0
-
src: ansistrano.rollback
version: 2.0.1
8 Comments
Hello, I came back to chapter 14 because I am using LiipImagineBundle and I have followed the same process you explain for /var/logs in /public/media. However, I am having a 500 error in my browser when it can try to render the images with filter. Do you know if I have to do something special in my ansible config for LiipImagineBundle?? I hope you can help me.
Hey Cesar!
I can do my best to help with that! So obviously, the first thing we need to find out is: what's the error that's causing the 500 error! Are you on production? Is that why you're not seeing the actual error message? If so, to find out, check your
var/logs/prod.logfile - it will contain the underlying exception.Let me know what you find out :).
Cheers!
Hi Ryan! Sorry for my delayed answer but with this coronavirus situation I have had some busy weeks.
I found the error in the logs. GD was not installed in my server so I fixed that and I changed my provision playbook too. Everything is working now.
For some reason, I didn't see the error before asking my question.
Thanks anyways and take care in these complicated times.
Hey, for Symfony 4 maybe for older versions too, you need to make sure there is a var directory in your symfony installation(it is untracked by default) before the symlink process, otherwise it will not work.
Hey achilleskal
Thanks for sharing it. Just for the record, if you create a new Symfony project via Symfony-CLI, then that folder will be created by default
Cheers!
Hi. I am on the screencast 14 and when I am trying to use the ansistrano_keep_releases variable, I get the error: cannot remove ā/var/www/project/releases/20171101171422Z/var/sessions/prod/sess_339q0lh6gbmn8oj2dvnc9g3q4eā: Permission denied.
I have tried to use a file command in the after_symlink_shared.yml (like the one you use for var) to set permissions in releases but is not working. Have you ever have this issue? I will appreciate any idea you can give me.
Hey Cesar,
Yeah, I faced this error once. It's because Ansistrano removes old releases without sudo, so if you have wrong permissions - you'll have this issue. So, first of all, you need to figure out what exactly permissions you have for those files. Run:
ls -la /var/www/project/releases/20171101171422Z/var/sessions/prod/sess_339q0lh6gbmn8oj2dvnc9g3q4e
Notice its permissions and its owner/group. Most probably you need to fix them, or maybe you just need to add the current "ubuntu" user to "www-data" group. Anyway, it depends on what permissions those files have.
P.S. As a workaround, if it's not a big deal for you, you can just comment out this ansistrano_keep_releases var and return to it later, when we fix the permissions properly. Actually, we're going to fix permissions properly in the next chapter :)
Cheers!
Thank you very much Victor. It works!
"Houston: no signs of life"
Start the conversation!