reviews symfony

Play with me in symfony2 game

Hi to all who can’t live without symfony 🙂

I’ve finally decided today to install symfony2 under Windows7 and see what the beast it is. Also it’s interesting to see its status, I really can’t believe s2 can be ready until end of year.

So I’ve decided to go with simplest “sandbox” way and after unzipping verify my environment by using this script (as proposed in quick start manual):


It turned out that I missed a few things

1. my PHP version is 5.2.6 (I had to install 5.3.2 so it’s good chance to finally look into namespaces and other goodies which it provides)
2. date.timezone = EU (I had to enter manually timezone in php.ini as it was commented out by default)
3. uncomment extension_dir = “ext” (this is commented by default) and uncomment these lines as well:

Once it’s done I’m good to go with example script:


Oops.. the following error appears:

Fatal error: Uncaught exception ‘InvalidArgumentException’ with message ‘[WARNING 1549] failed to load external entity “file:///C:usr/www/sandbox/src/vendor/symfony/src/Symfony/Components/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd” (in n/a – line 0, column 0) [WARNING 3084] Element ‘{}import’: Failed to locate a schema at location ‘file:///C:usr/www/sandbox/src/vendor/symfony/src/Symfony/Components/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd’. Skipping the import. (in in_memory_buffer – line 8, column 0) [ERROR 1845] Element ‘{}container’: No matching global declaration available for the validation root. (in file:///C:/usr/www/sandbox/src/vendor/symfony/src/Symfony/Foundation/Resources/config/services.xml – line 5, column 0)’ in C:\usr\www\sandbox\src\vendor\symfony\src\Symfony\Components\DependencyInjection\Loader\XmlFileLoader.php:283 Stack trace: #0 C:\usr\www\sandbox\src\vendor\symfony\src\Symfony in C:\usr\www\sandbox\src\vendor\symfony\src\Symfony\Components\DependencyInjection\Loader\XmlFileLoader.php on line 283

That was like the red stop sign to me but “no fear for the beer” 🙂
My friend google says that there is already solution (it is discussed here).

So the actual patch is provided here (it says patch going to be included into next symfony2 release):

Next attempt to run http://localhost/sandbox/web/index_dev.php/hello/SymfonyLab is failed again:

Uncaught exception ‘ErrorException’ with message ‘Warning: date() []: It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘Europe/Helsinki’ for ‘3.0/DST’ instead in C:\usr\www\sandbox\src\vendor\zend\library\Zend\Log\Logger.php line 255′ in C:\usr\www\sandbox\src\vendor\symfony\src\Symfony\Foundation\bootstrap.php:302 Stack trace: #0 [internal function]: Symfony\Foundation\Debug\ErrorHandler->handle(2, ‘date()

That’s easier to resolve as I used wrong timezone “EU” and had to replace with e.g. Europe/Helsinki.
Wuala, it works now!

New symfony2 manual is starting here. So if you like to play games like that one (fix and run) – it has definitely enough space for playing 🙂

In general it was very interesting also to read custom symfony2-related documentations on their “learn” page
I realized that symfony2 is actually very different. I’m also did not really find any mention about using of splitting application into modules which seems to be strange. I’d upset if they remove that part of symfony architecture. Oh symfony 1.0.x I’m missing you sooo much 🙁

3 replies on “Play with me in symfony2 game”

Theres no modules in Symfony2, they have been replaced by Bundles which contains Controllers etc 🙂

At first the Symfony2 change will seem like a big thing but when you actually get to dive into it you are going to love it.

It can be a pain in the ass to install sometimes, but the bundles system that was implemented seemed very clear to me when Fabien explained it on Symfony Live 2010.
It’s very logic, and I believe that if you read the correct documentation on how to use it, you could get convinced of it too.
have fun! 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *