Chapters
23 Chapters
|
2:20:28
|
Login to bookmark this video
-
Course Code
Subscribe to download the code!
Subscribe to download the code!
-
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!
06.
Configuring the Cache Service
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.
This tutorial also works great for Symfony 6!
What PHP libraries does this tutorial use?
// composer.json
{
"require": {
"php": "^7.3.0 || ^8.0.0",
"ext-ctype": "*",
"ext-iconv": "*",
"composer/package-versions-deprecated": "^1.11", // 1.11.99
"knplabs/knp-markdown-bundle": "^1.8", // 1.9.0
"sensio/framework-extra-bundle": "^6.0", // v6.2.1
"sentry/sentry-symfony": "^4.0", // 4.0.3
"symfony/asset": "5.0.*", // v5.0.11
"symfony/console": "5.0.*", // v5.0.11
"symfony/debug-bundle": "5.0.*", // v5.0.11
"symfony/dotenv": "5.0.*", // v5.0.11
"symfony/flex": "^1.3.1", // v1.21.6
"symfony/framework-bundle": "5.0.*", // v5.0.11
"symfony/monolog-bundle": "^3.0", // v3.6.0
"symfony/profiler-pack": "*", // v1.0.5
"symfony/routing": "5.1.*", // v5.1.11
"symfony/twig-pack": "^1.0", // v1.0.1
"symfony/var-dumper": "5.0.*", // v5.0.11
"symfony/webpack-encore-bundle": "^1.7", // v1.8.0
"symfony/yaml": "5.0.*" // v5.0.11
},
"require-dev": {
"symfony/maker-bundle": "^1.15", // v1.23.0
"symfony/profiler-pack": "^1.0" // v1.0.5
}
}
12 Comments
sudo apt install php8.0-apcudid it for me on Ubuntu 20.04In any case, I would say knowing how to set up your development environment is a reasonable prerequisite for these tutorials. But even if you can't figure out how to enable APCu support, as the tutorial says, you can use the noop Array cache for now and move on.
Hey davidmintz
Thanks for sharing ubuntu solution for it! It may be helpful =)
Cheers!
When I uncomment "app: cache.adapter.apcu" in the cache.yaml file to enable cache service configuration I get this Symfony Exception - CacheException
APCu is not enabled.
I tried installing APCu into my php directory and it still doesnt have any effect.
This is the full error I get in terminal
"C:\xampp\htdocs\symfony\symfony-fundamentals-course-2>php bin/console config:debug cache
PHP Warning: PHP Startup: Unable to load dynamic library 'php_apcu.dll' (tried: C:\xampp\php\ext\php_apcu.dll (The
specified module could not be found.), C:\xampp\php\ext\php_php_apcu.dll.dll (The specified module could not be fo
und.)) in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'php_apcu.dll' (tried: C:\xampp\php\ext\php_apcu.dll (The spec
ified module could not be found.), C:\xampp\php\ext\php_php_apcu.dll.dll (The specified module could not be found.)
) in Unknown on line 0
In ApcuAdapter.php line 28:
APCu is not enabled."
Hey Gediminas N.
By looking the DLL name that it's trying to load
php_php_apcu.dll.dllI think you wrote it wrong, it has the extension duplicatedCheers!
Hello, I am blocked at the point of the course from yesterday with the same error. I tried everything I found here and on internet but nothing works. APCu is not enabled. I am on windows 10 , tried with php 7.3 and now I try with php 8 but nothing works. I use phpstorm
Please someone help me, I can continue the study :(
Or is not so important to stay on this problem?
--------------------------------
I found out that in App_KernelDevDebugContainerCompiler.log ==================>>>>>>>>>>>>>>> Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass: Removed service "cache.adapter.apcu"; reason: abstract.
---------------------UPDATE-------------------------------------
I have done! I downgraded Symfony to 5.0.11 and then install APCu as here
https://stackoverflow.com/q...
Hey zahariastefan462!
Ah, congrats on sorting this out! I'm not sure why you would need to downgrade to Symfony 5.0.11 (that may not have been necessary), but I'm super glad you got APCu installed. Keep up the good work!
Cheers!
Hello, thank you for reply! I choose to downgrade to 5.0.11 because I saw that the version of the course was made on 5.0.11 and the current one is a bit different and is complicate to understand the course for someone not experienced like me. (for example kernel.php is different written). When I try to understand or do like in the course doesn't work for all things, I got different errors).
For APCu downgrading symfony was the only solution that works for me. I tried for 2 entire days to solve this out in other ways but I didn't find any other solution. Thank you again! I appreciate
Hello I have the same error with APCu is not enabled.
I run this on a Mac OS X ver. 10.15.7
how I can fix this?
should I switch the php version or so?
Hey Jörg daniel F.!
Hmm. This can, annoyingly, be complex. The short answer is that you should be able to install it with
pecl install pacu(you may need to sudo that, I can't remember). That should make everything work (though you'll need to restart your web server). However, if you have multiple versions of PHP on your machine, it's always possible something can go wonky.If you're using the default Mac OS X PHP (that one that comes pre-installed with PHP), I'd highly recommend installing Homebrew, installing PHP through it, and then running "pecl install apcu".
Let me know if that helps - I have a Mac, and I happily use Homebrew :).
Cheers!
Hello,
Same problem here that fUb had,
could you please make a tutorial about setting up PECL ? or give us an alternative way to set this kind of php extension up ?
I'm struggling with this part of the tutorial for more than 1 hour now,
and i'm still not able to find a proper tutorial on how to have this
working on php 7+ version, it seems that even if :
i pasted "extension=apcu.so" or "extension=php_apcu" in php.ini,
move the dll file into the ext folder of my current php version,
tried to do the same with the phpIniForApache file,
nothing worked out
basicaly the only thing that i'm actually doing is adding a new line on
the "server:start" return for the PHP-CGI, I have now more than 5 line
sayin
"Tailing PHP-CGI log file
(C:\Users\******\.symfony\log\39bd4f60ea1d574bf6b2c8b86a923cb74e6e5396\79ca75f9e90b4126a5955a33ea6a41ec5e854698.log)"
so i'm still stuck on the error frame with this info : "
Unaught Exception: APCu is not enabled.
{
"exception": {}
}
Uncaught PHP Exception
Symfony\Component\Cache\Exception\CacheException: "APCu is not enabled."
at
C:\wamp64\www\tuto\code-symfony-fundamentals\start\vendor\symfony\cache\Adapter\ApcuAdapter.php
line 28
{
"exception": {}
}
Could you please help me with this issue ?
Hey Yacine R.
The problem here is that the installation of
APCudepends on the OS, so Ryan can't explain how to do it for all cases. If you're using PECL, I think what you need to do is this:And probably that's it but I'd suggest you to Google for it because I unknow your local machine settings
I hope it helps. Cheers!
Hello Diego, thanks for your prompt reply
unfortunatly i'm on windows, so i cannot use directly "pecl" command, but in the end i manage to find my way out thanks to this link :
https://stackoverflow.com/questions/24448261/how-to-install-apcu-in-windows/42213575
"Houston: no signs of life"
Start the conversation!