Could anybody help me with the download link? I code along but since I could not download the page it takes me a little eternity to follow up. Thanks in advance.
Can´t you download the source code? There is a button at the right upper corner of this page named "Download" just click it and choose the option "Course code", or just go to: https://knpuniversity.com/s...
Hello, I tried to install the knp markdown bundle by using
composer require knplabs/knp-markdown-bundle
It located that the the version gonna be used is:
Using version ^1.4 for knplabs/knp-markdown-bundle
However, after that no other message was pop up regarding knp bundle but others packet having some kind of "satisfiable by" respond, none of which related to knp bundle.
I tried to fix the problem but it seems like I hit a dead end, nothing regarding knp bundle came out of my console, but when i tried to use
new Knp\Bundle\MarkdownBundle\KnpMarkdownBundle()
in my AppKernel but it always return a fatal error:
PHP Fatal error: Class 'Knp\Bundle\MarkdownBundle\KnpMarkdownBundle' not found in /home/cyberliem/encryAssign/myEncryptor/app/AppKernel.php on line 19
Is this the error at my end, or the KNP markdown bundle isn't there anymore?
Hmm, yes - you got a Composer dependency problem: there is *some* version incompatibility either with KnpMarkdownBundle or some existing packages in your project. So, the library was *not* downloaded. There could be many reasons for this (but it is weird). If you post the output from Composer (after running composer require) we should be able to find the problem :).
Can you post the output of your terminal after you run composer require knplabs/knp-markdown-bundle? As far as I know, you are the only ones that have had this issue, so it must be some small weird thing with your system (and something I'm sure we can fix!). The problem is somewhere in that terminal output, but sometimes it can be hard to dig through it and find the issue.
I can't post it anymore, but it was a dependecy error. As I started my Symfony track from scratch, composer wasn't able to find a viable solution for the new dependecy. I simply downloaded the source code from the tutorial and this fixed the issue.
Glad you got it fixed either way! If anyone else has a dependency error in the future, I'd still love to see the output to figure out the problem - I'm curious! :)
some minutes later I realized that I could edit the composer.json file and I added "knplabs/knp-markdown-bundle": "~1.3" and then updated with this command php composer.phar update. And now everything works :) thank you anyway ^^
Nice job finding the fix! In the future, you could have run "php composer.phar require ....". Basically, composer can be installed 2 different ways - either globally (so then you say composer require, or composer update) or just locally where you have a composer.phar file (then you say php composer.phar require, php composer.phar update). It can be a confusing thing - and you'll see both variants used in tutorials, because we're all split on how we install Composer :).
Hello, I have some problems, aqua_note project web-server doesn't start:
PHP Warning: require(/start/app/../vendor/autolload.php): failed to open stream: No such file or directory in /start/app/autoload.php on line 11
Fatal error: require(): Failed opening required '/home/../KNPU/start/app/../vendor/autoload.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/../KNPU/start/app/autoload.php on line 11
Download composer and then (in the project directory - e.g. the "start" directory) run:
php composer.phar install
(or just composer install - depending on how you installed Composer). I forgot to mention this step in the tutorial - there are more instructions in the README in that directory. But if you have issues after this, just let me know here :).
Whoops, looks like something went wrong. 1/1ClassNotFoundException in app_dev.php line 27:Attempted to load class "AppKernel" from the global namespace. Did you forget a "use" statement for e.g. "Symfony\Bundle\FrameworkBundle\Tests\Functional\app\AppKernel" or "Symfony\Bundle\SecurityBundle\Tests\Functional\app\AppKernel"? in app_dev.php line 27
During the work with composer, I had to reinstall it cause it showed me the following error: [Seld\JsonLint\ParsingException] "./composer.json" does not contain valid JSON Parse error on line 1: ^ Expected one of: 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['
Let's start with you composer.json first. This error means you have invalid JSON syntax. If you provide me you composer.json file - I could help you with it. You could post you composer.json content here, in comment, but better use GitHub Gist and just attach a link to your Gist in comment.
how do you download the source code? I have been looking over the course page and all the site, but can't find it here or in the github account for the site.
If course is not free - you should be logged in on KnpUniversity and have an access to a course (have a paid subscription or a purchased course you want to download). Then you should see a "Download" button on each screencast page of course in the top right corner. Let us know if you still have a problem with it.
Ah, Segmentation fault!!!! That's never good. Seg-faults are when PHP dies for some crazy reason, and it's *usually* (especially in a high quality library like Composer) due to some PHP bug or idiosyncratic issue on your system. It's not your fault, and it's rare, but these things happen. I have 2 suggestions:
1) Update to the latest version of Composer, just in case other people are having this issue and they have found some workaround for it
2) Upgrade your version of PHP. You probably don't need to upgrade to a whole new version (like 5.5 to 5.6 or 5.6 to 7), just a "patch" version (e.g. 5.5.10 to 5.5.12).
By the way, what version of PHP are you running? And what operating system?
Thank you for your tutorial. I'm new to Symfony and your help is just AWSOME !
Do you have a link to some page showing how to install/add bundles when Composer is not on the dev env ?... This is due to the Security Admin who didn't install Composer on the dev env.
It's easy enough! You need to download composer as a PHAR archive to the project directory and execute it with PHP, for example:
$ php composer.phar install
Check out the "Download Composer" section on https://getcomposer.org/download/ : it gives you the composer.phar file. Or just download it manually: check out the "Manual Download" section there. For example, you can download it using WGET or CURL utilities in your terminal:
Hey! I tried to install this via composer but after I installed composer, I move on to the next steps and it says (can not open input file: composer-setup.php)
Then when I tried to install the markdown bundle, it says (-bash: composer: command not found).
If you want to run "composer install" you have to installed it globally first: https://getcomposer.org/doc... And then, go to the root of your project (or where you have your composer.json file) and run again composer install
Sorry for the late response, that's weird if you installed it via composer require, a quick fix is to remove that line from your composer.json and running "composer require knplabs/knp-markdown-bundle" without specifying a version. Another fix would be specifying a constraint like "~1.1" or "1.2.*" (adjust numbers to the desired version) You can read more about composer versions here: https://getcomposer.org/doc...
Hey guys, i think i might have a problem, i downloaded all of the files needed, i even downloaded successfully the Knp Markdown bundle. But i saw that, when in terminal i write php bin/console debug:container markdown And then select the parser module to inspect it i shows me this:
// This service is an alias for the service markdown.parser.max
Information for Service "markdown.parser.max" =============================================
---------------- --------------------------------------------- Option Value ---------------- --------------------------------------------- Service ID markdown.parser.max Class Knp\Bundle\MarkdownBundle\Parser\Preset\Max Tags markdown.parser (alias: max) Public no Synthetic no Lazy no Shared yes Abstract no Autowired no Autoconfigured no ---------------- ---------------------------------------------
is there something wrong on having the public value set as "no"?
Not really, the public option is designed for determining whether or not you can fetch out that service from the container, in this case you can't, but that's the reason of the alias.
One question regarding performance, does it make sense to include Bundles like Markdownbundle in AppKernel.php *instead* of just inserting it into the controller it is being used, if they only get used very occasually? My question is, doesn't the performance of SF suffer from a lot of bundles inside AppKernel.php?
I'm not sure if you can *just* use it directly inside a Controller, Symfony needs to compile and configure the bundle, so everything can work correctly. I don't think there is a performance impact at run time, because Symfony caches a lot of things after doing the bootstrap process (A process that runs once and only when you clear the cache)
One real world example, I use the ramsey/uuid package which can be included into the app.kernel. But I only use this function one time at registration. So it seems to be the case that there isn't anything that justifies loading it at every request?! Would be great of you could shed some light onto the situation :)
I am getting the following warning/error when trying to run the server from the start folder. Is anyone able to diagnose this for me?
PHP Warning: require(/Users/<user>/Downloads/symfony-fundamentals/start/app/../vendor/autoload.php): failed to open stream: No such file or directory in /Users/<user>/Downloads/symfony-fundamentals/start/app/autoload.php on line 11
Warning: require(/Users/<user>/Downloads/symfony-fundamentals/start/app/../vendor/autoload.php): failed to open stream: No such file or directory in /Users/<user>/Downloads/symfony-fundamentals/start/app/autoload.php on line 11 PHP Fatal error: require(): Failed opening required '/Users/<user>/Downloads/symfony-fundamentals/start/app/../vendor/autoload.php' (include_path='.:') in /Users/<user>/Downloads/symfony-fundamentals/start/app/autoload.php on line 11
Fatal error: require(): Failed opening required '/Users/<user>/Downloads/symfony-fundamentals/start/app/../vendor/autoload.php' (include_path='.:') in /Users/<user>/Downloads/symfony-fundamentals/start/app/autoload.php on line 11
B) In your terminal, move into your project. Then use Composer to download your project's dependencies:
php composer.phar install```
Some people also install composer as a global command. In that case, the command would simply be `composer install`
Why did this happen? The `vendor/` directory in your project - which is where Symfony and all the other vendor libraries live - is empty! This directory should also contain a file that helps Symfony boot up - that's the `vendor/autoload.php` file error that you're getting.
Why is this directory empty? The `vendor/` directory is ignored from git, and also/similarly not included in our file download. And that's no problem - if I were to clone a project that you created, the `vendor/` directory *will* and *should* be empty. As a PHP dev, I know to run `composer install` to populate it.
This is also mentioned in the `README.md` file in the `start/` directory of the code download. But, I wanted to give you a bit more background... just in case it was useful!
Cheers!
Super weird! It's possible that when you installed KnpMarkdownBundle and updated your app/AppKernel.php file (which is part of that process), you accidentally changed something else in that file, which broke things. If things were working before, then check that file to make sure that everything looks right - e.g. that the <<php sign is still there (this happens more than you think) and that the class still is called AppKernel (you didn't accidentally hit an extra key on your keyboard, etc).
Let me know what you find out! If everything looks good, post your AppKernel.php file here (I assume you haven't modified the bin/console file, so no need to see that).
It does not work... I have installed a composer to php/my_symfony folder. php/my_s/composer.phar require knplabs/knp-markdown-bundle. I have it and... nothing. new Knp\Bundle\MarkdownBundle\KnpMarkdownBundle(), is still red. Why?
'Knp\\Bundle\\MarkdownBundle\\' => array($vendorDir . '/knplabs/knp-markdown-bundle'), I have it but (1/1) ClassNotFoundException Attempted to load class "KnpMarkdownBundle" from namespace "Knp\Bundle\MarkdownBundle". Did you forget a "use" statement for another namespace?
68 Comments
Could anybody help me with the download link? I code along but since I could not download the page it takes me a little eternity to follow up. Thanks in advance.
Can´t you download the source code? There is a button at the right upper corner of this page named "Download" just click it and choose the option "Course code", or just go to: https://knpuniversity.com/s...
Cheers!
Hello, I tried to install the knp markdown bundle by using
composer require knplabs/knp-markdown-bundle
It located that the the version gonna be used is:
Using version ^1.4 for knplabs/knp-markdown-bundle
However, after that no other message was pop up regarding knp bundle but others packet having some kind of "satisfiable by" respond, none of which related to knp bundle.
I tried to fix the problem but it seems like I hit a dead end, nothing regarding knp bundle came out of my console, but when i tried to use
new Knp\Bundle\MarkdownBundle\KnpMarkdownBundle()
in my AppKernel but it always return a fatal error:
PHP Fatal error: Class 'Knp\Bundle\MarkdownBundle\KnpMarkdownBundle' not found in /home/cyberliem/encryAssign/myEncryptor/app/AppKernel.php on line 19
Is this the error at my end, or the KNP markdown bundle isn't there anymore?
Hi there!
Hmm, yes - you got a Composer dependency problem: there is *some* version incompatibility either with KnpMarkdownBundle or some existing packages in your project. So, the library was *not* downloaded. There could be many reasons for this (but it is weird). If you post the output from Composer (after running composer require) we should be able to find the problem :).
Cheers!
I do have the same problem here. Any solutions, yet ?
Hey Thorsten!
Can you post the output of your terminal after you run composer require knplabs/knp-markdown-bundle? As far as I know, you are the only ones that have had this issue, so it must be some small weird thing with your system (and something I'm sure we can fix!). The problem is somewhere in that terminal output, but sometimes it can be hard to dig through it and find the issue.
Cheers!
I can't post it anymore, but it was a dependecy error. As I started my Symfony track from scratch, composer wasn't able to find a viable solution for the new dependecy. I simply downloaded the source code from the tutorial and this fixed the issue.
Glad you got it fixed either way! If anyone else has a dependency error in the future, I'd still love to see the output to figure out the problem - I'm curious! :)
Cheers!
Hey guys :) I can't manage to get the markdown bundle via composer, once I launch the command I get this response:
MacBook-Pro-di-Marco:aqua_note Marco$ composer require knplabs/knp-markdown-bundle
-bash: composer: command not found
what am I doing wrong ?
some minutes later I realized that I could edit the composer.json file and I added "knplabs/knp-markdown-bundle": "~1.3" and then updated with this command php composer.phar update. And now everything works :) thank you anyway ^^
Hey Marco!
Nice job finding the fix! In the future, you could have run "php composer.phar require ....". Basically, composer can be installed 2 different ways - either globally (so then you say composer require, or composer update) or just locally where you have a composer.phar file (then you say php composer.phar require, php composer.phar update). It can be a confusing thing - and you'll see both variants used in tutorials, because we're all split on how we install Composer :).
Cheers!
Hello, I have some problems, aqua_note project web-server doesn't start:
PHP Warning: require(/start/app/../vendor/autolload.php): failed to open stream: No such file or directory in /start/app/autoload.php on line 11
Fatal error: require(): Failed opening required '/home/../KNPU/start/app/../vendor/autoload.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/../KNPU/start/app/autoload.php on line 11
Hi there!
Download composer and then (in the project directory - e.g. the "start" directory) run:
(or just composer install - depending on how you installed Composer). I forgot to mention this step in the tutorial - there are more instructions in the README in that directory. But if you have issues after this, just let me know here :).
Cheers!
Hi! I've done everything you explain and got
Whoops, looks like something went wrong.
1/1ClassNotFoundException in app_dev.php line 27:Attempted to load class "AppKernel" from the global namespace.
Did you forget a "use" statement for e.g. "Symfony\Bundle\FrameworkBundle\Tests\Functional\app\AppKernel" or "Symfony\Bundle\SecurityBundle\Tests\Functional\app\AppKernel"?
in app_dev.php line 27
During the work with composer, I had to reinstall it cause it showed me the following error:
[Seld\JsonLint\ParsingException]
"./composer.json" does not contain valid JSON
Parse error on line 1:
^
Expected one of: 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['
How can I solve my issue?
Hey Andjii,
Let's start with you composer.json first. This error means you have invalid JSON syntax. If you provide me you composer.json file - I could help you with it. You could post you composer.json content here, in comment, but better use GitHub Gist and just attach a link to your Gist in comment.
Cheers!
Thank you! I've found out that my composer.json is absolutely clear.... Don't I don't know, why. Now I restored it and everything works fine=))
how do you download the source code? I have been looking over the course page and all the site, but can't find it here or in the github account for the site.
Hey Guvenc,
If course is not free - you should be logged in on KnpUniversity and have an access to a course (have a paid subscription or a purchased course you want to download). Then you should see a "Download" button on each screencast page of course in the top right corner. Let us know if you still have a problem with it.
Cheers!
The Source code is downloadable on the first Course not on this page !
The fuirst Symfony course is here : http://knpuniversity.com/sc...
Hi,
Here is the output:
$ composer require knplabs/knp-markdown-bundle
Using version ^1.5 for knplabs/knp-markdown-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing symfony/polyfill-apcu (v1.2.0)
- Removing psr/cache (1.0.0)
- Removing twig/twig (v1.24.0)
- Installing twig/twig (v1.23.1)
/c/ProgramData/ComposerSetup/bin/composer: line 10: 5260 Segmentation fault php "${dir}/composer.phar" "$@"
Alternatively I run:
$ composer dump-autoload
$ composer update
Output:
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing twig/twig (v1.24.0)
- Installing twig/twig (v1.24.1)
/c/ProgramData/ComposerSetup/bin/composer: line 10: 8376 Segmentation fault php "${dir}/composer.phar" "$@"
How can I fix this?
Ah, Segmentation fault!!!! That's never good. Seg-faults are when PHP dies for some crazy reason, and it's *usually* (especially in a high quality library like Composer) due to some PHP bug or idiosyncratic issue on your system. It's not your fault, and it's rare, but these things happen. I have 2 suggestions:
1) Update to the latest version of Composer, just in case other people are having this issue and they have found some workaround for it
2) Upgrade your version of PHP. You probably don't need to upgrade to a whole new version (like 5.5 to 5.6 or 5.6 to 7), just a "patch" version (e.g. 5.5.10 to 5.5.12).
By the way, what version of PHP are you running? And what operating system?
It's Windows 8 and the newest PHP version 7.06 + newest composer. I have tried to play around with different PHP versions and it turned to be futile.
Ah, Windows sometimes not so friendly for PHP developers. :(
How did you install PHP on your OS? Do you use any local web server packs like XAMPP or something similar?
Hi Ryan,
Thank you for your tutorial. I'm new to Symfony and your help is just AWSOME !
Do you have a link to some page showing how to install/add bundles when Composer is not on the dev env ?...
This is due to the Security Admin who didn't install Composer on the dev env.
Thank's a lot !
Abou.
Hey Abou,
It's easy enough! You need to download composer as a PHAR archive to the project directory and execute it with PHP, for example:
Check out the "Download Composer" section on https://getcomposer.org/download/ : it gives you the
composer.pharfile. Or just download it manually: check out the "Manual Download" section there. For example, you can download it using WGET or CURL utilities in your terminal:Cheers!
Thank you so much !
Abou
You're welcome, Abou! ;)
Now I got a cache:clear issue, then the install of composer won't complete. A permission problem. I'll handle this...
Thank you anyway !
After using your method does the use of composer remain the same ? I mean should I use the command composer as described in this tutorial ?...
*Don't minde ! I figured it out... I have to use "composer.phar" instead of "composer" as command !
Thank you anyway !
Cheers,
Abou
Yo Abou,
Check the https://getcomposer.org/doc... to install Composer globally on your server, then you can use it the same way we do in our tutorials ;)
Cheers!
Hey!
I tried to install this via composer but after I installed composer, I move on to the next steps and it says (can not open input file: composer-setup.php)
Then when I tried to install the markdown bundle, it says (-bash: composer: command not found).
Thanks for the help :)
Hey Brian!
If you want to run "composer install" you have to installed it globally first: https://getcomposer.org/doc...
And then, go to the root of your project (or where you have your composer.json file) and run again composer install
I hope this fix your problem :)
Cheers!
Thank you! Worked :)
Now I get this (Please provide a version constraint for the knplabs/knp-markdown-bundle requirement)
Hey Brian!
Sorry for the late response, that's weird if you installed it via composer require, a quick fix is to remove that line from your composer.json and running "composer require knplabs/knp-markdown-bundle" without specifying a version.
Another fix would be specifying a constraint like "~1.1" or "1.2.*" (adjust numbers to the desired version)
You can read more about composer versions here: https://getcomposer.org/doc...
Have a nice day!
Hey guys, i think i might have a problem,
i downloaded all of the files needed, i even downloaded successfully the Knp Markdown bundle. But i saw that, when in terminal i write
php bin/console debug:container markdown
And then select the parser module to inspect it
i shows me this:
// This service is an alias for the service markdown.parser.max
Information for Service "markdown.parser.max"
=============================================
---------------- ---------------------------------------------
Option Value
---------------- ---------------------------------------------
Service ID markdown.parser.max
Class Knp\Bundle\MarkdownBundle\Parser\Preset\Max
Tags markdown.parser (alias: max)
Public no
Synthetic no
Lazy no
Shared yes
Abstract no
Autowired no
Autoconfigured no
---------------- ---------------------------------------------
is there something wrong on having the public value set as "no"?
Thanks for everythig, this tutorials are awesome
Hey Ian
Not really, the public option is designed for determining whether or not you can fetch out that service from the container, in this case you can't, but that's the reason of the alias.
Cheers!
One question regarding performance, does it make sense to include Bundles like Markdownbundle in AppKernel.php *instead* of just inserting it into the controller it is being used, if they only get used very occasually?
My question is, doesn't the performance of SF suffer from a lot of bundles inside AppKernel.php?
Hey Mike P.
I'm not sure if you can *just* use it directly inside a Controller, Symfony needs to compile and configure the bundle, so everything can work correctly. I don't think there is a performance impact at run time, because Symfony caches a lot of things after doing the bootstrap process (A process that runs once and only when you clear the cache)
Cheers!
One real world example, I use the ramsey/uuid package which can be included into the app.kernel. But I only use this function one time at registration. So it seems to be the case that there isn't anything that justifies loading it at every request?!
Would be great of you could shed some light onto the situation :)
Guys, where are the exercise files or the "tutorials" folder? I just COULDN'T find it =/
I replied you in the other comment. Could you find it?
Thank you, Diego! :)
I am getting the following warning/error when trying to run the server from the start folder. Is anyone able to diagnose this for me?
PHP Warning: require(/Users/<user>/Downloads/symfony-fundamentals/start/app/../vendor/autoload.php): failed to open stream: No such file or directory in /Users/<user>/Downloads/symfony-fundamentals/start/app/autoload.php on line 11
Warning: require(/Users/<user>/Downloads/symfony-fundamentals/start/app/../vendor/autoload.php): failed to open stream: No such file or directory in /Users/<user>/Downloads/symfony-fundamentals/start/app/autoload.php on line 11
PHP Fatal error: require(): Failed opening required '/Users/<user>/Downloads/symfony-fundamentals/start/app/../vendor/autoload.php' (include_path='.:') in /Users/<user>/Downloads/symfony-fundamentals/start/app/autoload.php on line 11
Fatal error: require(): Failed opening required '/Users/<user>/Downloads/symfony-fundamentals/start/app/../vendor/autoload.php' (include_path='.:') in /Users/<user>/Downloads/symfony-fundamentals/start/app/autoload.php on line 11
Yo Ed!
I know this error! First, let's fix it. Then, we can discuss why this may have happened. Here is the fix:
A) Download Composer https://getcomposer.org/download/
B) In your terminal, move into your project. Then use Composer to download your project's dependencies:
Ah the old, you can't run this programme until you've completed the steps on the readme error..
Thanks a lot for both the direction and the background information.
Hi,
I have a problem, after install knplabs/knp-markdown-bundle, when i try to start the console i says to me:
PHP Fatal error: Class 'AppKernel' not found in /home/wfg/aqua_note/bin/console on line 27
Any idea?
Hi Javier!
Super weird! It's possible that when you installed KnpMarkdownBundle and updated your app/AppKernel.php file (which is part of that process), you accidentally changed something else in that file, which broke things. If things were working before, then check that file to make sure that everything looks right - e.g. that the <<php sign is still there (this happens more than you think) and that the class still is called AppKernel (you didn't accidentally hit an extra key on your keyboard, etc).
Let me know what you find out! If everything looks good, post your AppKernel.php file here (I assume you haven't modified the bin/console file, so no need to see that).
Cheers!
./bin/console debug:container markdown does not work on Windows. How it is on Windows?
Hey Alexander,
It's difficult to understand what's wrong because don't show the error you have, but I suppose you need to run Symfony console through php, try this:
$ php ./bin/console debug:container markdown
If you still have an issue, show us the error you have
Cheers!
It does not work... I have installed a composer to php/my_symfony folder. php/my_s/composer.phar require knplabs/knp-markdown-bundle. I have it and... nothing. new Knp\Bundle\MarkdownBundle\KnpMarkdownBundle(), is still red. Why?
Write use Knp\Bundle\MarkdownBundle\MarkdownParserInterface; in AppKernel.php.
This worked for me.
'Knp\\Bundle\\MarkdownBundle\\' => array($vendorDir . '/knplabs/knp-markdown-bundle'), I have it but (1/1) ClassNotFoundException
Attempted to load class "KnpMarkdownBundle" from namespace "Knp\Bundle\MarkdownBundle".
Did you forget a "use" statement for another namespace?
"Houston: no signs of life"
Start the conversation!