// composer.json
{
"require": {
"php": "^7.1.3",
"composer/package-versions-deprecated": "^1.11", // 1.11.99
"doctrine/doctrine-bundle": "^1.6", // 1.8.1
"doctrine/doctrine-cache-bundle": "^1.2", // 1.3.2
"doctrine/doctrine-migrations-bundle": "^1.1", // v1.3.1
"doctrine/orm": "^2.5", // v2.7.2
"fzaninotto/faker": "^1.7", // v1.7.1
"knplabs/knp-markdown-bundle": "^1.4", // 1.6.0
"sensio/framework-extra-bundle": "^5.0", // v5.1.3
"stof/doctrine-extensions-bundle": "dev-master", // dev-master
"symfony/asset": "^4.0", // v4.0.1
"symfony/console": "^4.0", // v4.0.1
"symfony/flex": "^1.0", // v1.9.10
"symfony/form": "^4.0", // v4.0.1
"symfony/framework-bundle": "^4.0", // v4.0.1
"symfony/lts": "^4@dev", // dev-master
"symfony/maker-bundle": "^1.0", // v1.0.2
"symfony/monolog-bundle": "^3.1", // v3.1.2
"symfony/polyfill-apcu": "^1.0", // v1.6.0
"symfony/profiler-pack": "^1.0", // v1.0.3
"symfony/security-bundle": "^4.0", // v4.0.1
"symfony/security-csrf": "^4.0",
"symfony/swiftmailer-bundle": "^3.1", // v3.1.6
"symfony/translation": "^4.0", // v4.0.1
"symfony/twig-bundle": "^4.0", // v4.0.1
"symfony/validator": "^4.0", // v4.0.1
"symfony/web-server-bundle": "^4.0", // v4.0.1
"symfony/yaml": "^4.0" // v4.0.1
},
"require-dev": {
"symfony/dotenv": "^4.0", // v4.0.1
"symfony/phpunit-bridge": "^4.0", // v4.0.1
"doctrine/doctrine-fixtures-bundle": "^3.0" // 3.0.2
}
}
13 Comments
Question: What are these lines doing ?
`
"symfony": {
`
Hey Helmis D.
It tells composer that you trust on Symfony recipes that comes from the community (https://github.com/symfony/... ). If you set it to false, it won't execute such recipes, or if you remove it, it will always ask you if you want to execute them.
Cheers!
Question: We are currently at Symfony 4.3. Will the tutorial work if I use the composer.json from that branch? Or should I use this <a href="https://github.com/symfony/skeleton/blob/4.0/composer.json">composer.json</a> from the 4.0 branch?
Also, this file seems to be structured a bit differently now. At some point Ryan says to copy the "require" section of composer.json to get the framework-bundle. But in the latest composer.json, the framework-bundle is in a separate section called "flex-require." I tried copying both the "require" and "flex-require" sections, but I then get an error with
composer update.Hey John christensen
I think you should copy the composer.json from 4.3 release. Indeed it's different and probably it will require some adjustments but the main concepts of this tutorial still apply. Can you show me the error you got? So I can help you debugging it
Cheers!
After this video I refreshed my project in the browser and this is what I've got.
`
Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required '..../vendor/symfony/symfony/src/Symfony/Bundle/WebServerBundle/Resources/router.php' (include_path='.:/usr/local/php5/lib/php') in Unknown on line 0
`
After googling I found out that I have exactly this issue: https://github.com/symfony/symfony/issues/25515
But I am now stuck because I have no idea what needs to be done and I am kind of useless with composer and github generally.
Everything whats in this video I have done and saw same messages on my mac but could someone point me what should I do.
Also please explain it like I was 6yrs old.
my composer.json if thats needed.
`
{
}
`
Hey Peter!
No worries - I'm sure we can figure this out! Actually, the issue is you're just a bit ahead of us :). We will see this issue a few chapters from now (and I know, we're still releasing so you can't see it yet!). The problem is that we actually uninstalled the old "server:run" code. Later, we will install the NEW code and re-run this command. At this point, it should be broken. The solution (which you'll see later), is to run
composer require server. Then, close the terminal with the old web server, open a new terminal and re-runbin/console server:run. This will restart the web server (but look at what port it says it's running on - it may not be 8000, because the old web server command gets SO confused, it may still be running on port 8000 until you restart).Cheers!
Hi Guys,
for beginners be very careful here. I am new to symfony, composer and console. I was trying to develop my old project that wasnt using any framework to symfony. I was skipping tutorials based on what I needed. Everything was working in symfony version 3 what I learned and I was really happy how easy it is.
Then I wanted to upgrade to symfony 4 so first thing that will fail is your build in webserver that will run 5.6.30 on sierra so you need to upgrade it to run composer I think. Thats probably where things get messed up. Because my php -v still showed 5.6.30 however I installed 7.2 somehow I managed to show 7.2 in terminal after I typed php -v so I continue to watched this video/tutorial. Today I managed to broke my whole project when running composer update. I cant even run php bin/console server:run that was working on symfony 3 version because bin/console didnt even exist so be very carefull I have no idea what I did because I was trying to fix it and probably broke other 10 thinks. Lesson learned for me to run backups and I can start from scratch.
Also this is probably why I do not trust framework. It is so easy to to break things. When you are not using framework and you will remove file you know it will break something but here I have no idea what will happen when I delete 1 file somewhere deeeeep in vendor folder.
Well at least it will force me to wait and watch symfony 4 tutorial here so I can start again.
Yo Peter!
Yea, sorry about that :). You should definitely create a new branch so you can do all of the Symfony 4 upgrade craziness over on that branch. If ALL else fails, revert all of your changes (including composer.json and composer.lock), then completely remove the vendor/ directory and run
composer install. This will completely reset your vendor. directory.But yea, we'll have the rest of the tutorial out soon - it's a bit of tricky surgery to get all the steps down for this one-time upgrade to the Flex structure. So, definitely come back! The new structure is totally worth it :).
Cheers!
Same here, application broken !
At the end I think it was a false good idea to start this course before it was completly published.
Ha ha ha !!
So I'm just gonna wait and pray for a quick release.
Cheers up KNP team ;)
Haha, yep, sorry about that. Bad time with the holidays! The next chapter is out tomorrow :D
Aye thats what I am doing, just waiting for more people with comments so maybe they will have similar issues.
I also regret I didnt wait till whole course is published.
Haha, you guys probably shouldn't apply changes to the production until the course is completely published :D
I am glad that I have experienced this. I am still learning so this is a lesson for me.
You guys doing great job anyway!!!
"Houston: no signs of life"
Start the conversation!