Symfony Woes
I’ve finally found time to start investigating some other PHP frameworks, and after some brief research I decided to start off with Symfony. All is going well and so far I’m impressed with what Symfony can do compared with CakePHP… with a few exceptions.
I initially tried following the My First Project tutorial, but hit problems pretty quickly. It would seem that there was a problem with the PHP SQLite extension. The phpinfo() function verified that SQLite was indeed installed, but I couldn’t get any further on that trail. After reading a number of forum posts on the issue, it became apparent I should recompile Apache and PHP. I’m still not that confident with Linux to do that so I left it at that.
Then I followed the Askeet tutorial with more success as this tutorial uses MySQL rather than SQLite. However, I can’t get the URL rewriting to work as it should. I’ve checked my Apache configuration, the .htacces file and still no luck. If I load http://<project>/question I get a 404 error. If I load http://<project>/index.php/question or http://<project>/frontend_dev.php/question all is well. I’ll press on with this tutorial until I hit a road block, but this is really bugging me. Again, a few forum posts suggest recompiling Apache and PHP. However, the extensions that should be included in the new build are already present according to phpinfo().
I’m currently running Fedora 7 which installs Apache and PHP in its own odd way. Perhaps I should start from scratch by removing Apache and PHP with yum and compiling both from source. Although as I said I’m kind of reluctant to do that. If anyone has any ideas – let me know!








8 Comments, Comment or Ping
max
Cracked it! I had a ‘-’ instead of an ‘_’ in my Directory directive of the VirtualHost section in httpd.conf. Oh well, too much coding for one day!
Aug 15th, 2007
Nate
Heh, there’s a reason we get so many people switching to Cake from Symfony… several actually.
Aug 15th, 2007
max
Nate, I certainly didn’t mean to make an inflamatory comment against CakePHP. I just prefer the way things go in Symfony so far. That’s not to say there won’t come a point where I miss the ways of Cake and move back again. I think it’s important for developers to get experience with as many frameworks and platforms as possible as I am doing. Just to clarify, CakePHP is an excellent framework – I just wanted to try Symfony
Aug 15th, 2007
Paul Lomax
Nate – Who’s switching from Symfony to Cake? And why?
Aug 21st, 2007
Tal Ater
Those are all server and OS issues you’re running into, not Symfony issues. Power through them and get to know the framework. It’s great.
I’ve switched to Symfony from CakePHP about a year and a half ago, and am very, very happy that I did… In fact I just started work on a new site two days ago, and once again chose Symfony.
Aug 22nd, 2007
Bert-Jan
If you application works fine when you access it with frontend_dev.php, but not without, you should clear the cache (run symfony cc).
The dev-mode bypasses certain caches so you see changes happening as you’re working. Not all caches are bypassed though, this can cause some trouble when e.g. you’ve added a new class in a lib directory. The cache that holds the lib locations is not bypassed in dev-mode.
Just run symfony cc when something doesn’t seem right. After that, if there’s still a problem, there really is a problem.
Aug 22nd, 2007
max
I think I have resolved the problem now. Either way, I’ve been using a proper MySQL database rather than SQLite since I’m more likely to use MySQL in a production environment. Thanks.
Aug 22nd, 2007
halfer
Database and URL rewriting issues such as these could well happen on Cake, or, indeed, any other framework; as Tal says, they’re not down to symfony. I’m sure there are people moving from Cake to/from Symfony in both directions, and this is fine – people should use what they’re happy with. Meanwhile, ongoing improvements to both keep the general quality of framework-driven PHP code high – competition is healthy
)
Max, if you do have further problems, and haven’t already joined the symfony fora, then please do so – there’s a number of people there happy to help out with related problems as well as symfony ones.
Aug 22nd, 2007
Reply to “Symfony Woes”