I've spent ages reading about the pros and cons of all the major PHP Frameworks (i.e. Zend [1], CakePHP [2], Symfony [3], CodeIgniter [4], etc., etc.). I've also read most of the questions and answers already posted in here about PHP Frameworks and I STILL can't make up my mind as to which one I should go with. So I thought I'd ask you good people for your opinions based on my own background.
OK, I'm pretty new to developing PHP (background in ASP.NET originally) I've been hacking PHP since 2000, but never developed anything from scratch. But I'm looking to build a Web 2.0 style application with PHP which will run similar to Basecamp [5] using a software as a service model eventually to make money from it.
I'm building this on my own as a personal side project outside of my 9-5 so my time is limited to weekends/nights.
I'm looking for a framework so I can standardize my development methods and all the other reasons one would want to use a framework and I've narrowed it down to:
My analysis tells me I've listed the frameworks above by the most complex down to the simplest. CodeIgniter might get me up and running quickly but doesn't have all the bells and whistles of Symfony. Symfony will take me longer to learn but ultimately might be the best choice in the long run - not to mention the excellent Askeet [6] tutorial and the fact that Yahoo uses it for some of it's newer projects.
My problem now is making the decision. All the frameworks above are potential candidates. I'm not under a massive deadline to get this done (only my own expectations to meet!) but I do have limited time. Should I start out with CodeIgniter or dive straight in at the deep end with Symfony and take the extra time to learn a complex framework?
It seems it has become a rule that I update this once a year. It also shows how fast time goes by... did SO really already exist 4 years ago and I used it... crazy. Well, this year I'm gonna make this edit a bit longer since there are a few things worth mentioning.
The existence and constant dissemination of GitHub, Composer/Packagist, the FIG, etc. has lead to a much narrower gap between frameworks and makes it much easier to pick'n'chose between the best suited components of different frameworks. As an example. We just migrated a rather large software from ZF1 to ZF2, I liked the Symfony Session component better than the still undocumented Zend\Session so I just required the respective component with composer and wrote an Zend\Authentication\Storage\SymfonySession Adapter by implementing a simple interface. Now we're using Symfony Session in our ZF2 app.
Update, February 2013: Well, we needed to crawl back on that one. It turns out ZF has the session hardcoded into Captcha and the Csrf element. The 'modular' claim is more a promise than a reality currently.
Zend Framework and Symfony are still rocking the boat, and it's not really a good argument to say they're full stack frameworks and therefore not good for this or that... both ZF2 and Symfony2 are quite close to perfect decoupling (still possible to improve, sure). But there is also a new interesting and promising player on the market: Laravel 4. Be sure to check it out, if you're on the search for a PHP framework.
And don't forget to look into micro frameworks (simple request/response handling) and consider the pick'n'chose library approach.
I and my company are still using ZF for dozens of customer projects, we're still looking forward to ZF2. In the meantime IMO ZF and Symfony have emerged as the clear leaders unless you need a micro framework.
I'm still using ZF with success and having my hopes high for the promises of version 2. I'm even considering basing a big online service on ZF.
In the meantime I've realised five projects with Zend Framework and I'm satisfied and more and more thrilled and will continue learning and using it! The greatest addition recently is Zend_Tool which contributes a lot to the RADfullness of ZF.
I'm currently struggling with almost exactly the same situation. I've also read the previous Stack Overflow Q&As about this topic (especially this [1], this [2] and this [3]) and I also couldn't make up my mind yet.
Here some thoughts I came up with so far:
first of all reading the linked answers only helps to a certain extent by making your aware of different frameworks and pointing out the most obvious limitations and strengths on the other hand you get more and more confused because ppl tend to disagree and to be biased towards the product they've used most and are therefore most comfortable with
so, thanks to the existing Q&As it was easy to visit the webpages of the different products and try to get an overview and a feel of how active the community might be, etc. I don't think it is a good idea to use a community driven product if the board is full of flame wars and documentation has spelling mistakes, I tend to believe that social skills and English language skills are correlates of good overall development outcome
I'm amazed that your list doesn't include Zend Framework! As to the why-ness of this I would like to report another potentially flawed thinking-chain of mine which started to establish itself shortly after reading most of the Q&As around here: Well, it looks like it has to be Zend Framework, it's extensive, it's flexible it's OO it's PHP5 it has a strong company plus a community behind it, therefore it has a future, ... but it looks too hard to learn, it's scary. So what about CodeIgnitor, it seems easy to learn and is recommended and praised by many... BUT it's not PHP5, where's the future? well then let's try Kohana BUT that really doesn't look promising if you read some of their discussions and the discussions at CI and check their documentation. Oh, but there is also CakePHP, BUT what a lousy webpage, phew and everybody rants about their documentation and documentation is exactly what I need. So maybe I should try Symfony but uh already the installation looks scary and it doesn't look much easier to learn then Zend Framework so why not using that in the end... :$ and so on and so forth
I would really love to see some strong statements of some authorities in the business who surely stick around here too! I would really appreciate that because I'm a relative noob when it comes to PHP frameworks and all the biased praise of semi-authorities just don't help. I mean I'm aware of the fact that every framework has some strong points and some serious drawbacks but there must be a little bit more consensus out there among the big PHP names...
As for a concise answer to your question if only the three frameworks listed by you are chosable I think in a broader perspective including future development it should be Symfony.
[1] http://stackoverflow.com/questions/20709/which-php-framework-will-get-me-to-a-usable-ui-the-fastestMy personal choice of framework is CakePHP, and I cannot recommend it enough. People say it is slow and bloated, but that is not true. All frameworks bring overhead, and it's the same with cake. With proper usage of caching and query optimization it is fast as any other framework out there. If you think it's slow, you haven't played enough with it.
One thing is also important with cake: it is very strict and goes by "convention over configuration" principle. This is very good and it will make you a better developer. This is something I am sure of.
HOWEVER
I strongly suggest you try each and every one of those and see which one is the best for you. Frameworks are mostly like shoes, one size doesn't fit all (unless you're in the army). I have written a short article about this topic, if you care to take a look [1].
[1] http://lecterror.com/articles/view/let-me-compare-frameworks-for-a-feeA problem you'll experience with web 2.0 is that the fancier your app becomes, the more you will need to code in javascript, and the more you code in javascript, the more the PHP framework will have to get out of the way.
As a consequence, you may find that your decision comes down to which frameworks integrate best with the javascript framework of your choice.
I've chosen Zend Framework underneath ExtJS for this reason. On the server-side, I'm implementing simple web services, and the app is essentially coded as client-side javascript on top of ExtJS.
in case anyone is interested in this thread, I think I've been able to make a decision based on the answers I received here.
I'm going to start off with CodeIgniter. The fact the symfony has such a long learning curve and the fact that their askeet tutorial is out of date ruled out symfony for me.
That then left with a difficult choice between CakePHP and CodeIgniter. The fact that CodeIgniter seems to have a shorter learning curve has swung it for me and I'm staying true to the Keep It Simple Stupid mantra.
While CodeIgniter might not meet with satisfaction of some MVC purists and while it does have some fundamental issues (i.e. PHP4, loose MVC implementation etc. etc. etc.) I'm willing to sacrifice these for now to get a rapid prototype for my app working.
Who knows at some point in the future I may review my decision and migrate to CakePHP or symfony (I see them like stepping stones now), for the moment, CodeIgniter looks like it will do everything I need to meet MY needs.
Good luck to everyone else trying to make a decision on their PHP Framework.
Who knows, at some point in the future I might build the app in all 3 frameworks and document my experiences to the benefit of others in my current predicament!
I already post a question about Symfony [1] and after 1 weekend I can tell you that it's harder than it looks.
First, tutorial have a lot of error in it. I had to go in the IRC channel more than 5 times...
Second, the big project, Askee on the website that show you how Symfony works with bigger project is writtent for a PAST version and is not 100% compatible with the release version == lot of problem to try it to make it work.
I had a lot of expectation for Symfony but have been really disappointed. But, I have to admit that the ORM (I think propel) is very nice and when you know how all the framework works might be one of the best... but documentation is not the strongest point of this framework,
[1] http://stackoverflow.com/questions/133701/symfony-framework-is-a-good-framework-to-learnOne little comment about Symfony documentation:
Symfony 1.1 was a temp/intermediary version that was not well documented. But since symfony 1.2, the core team is working hard on the documentation, especially on the new advent calendar Joobeet (that replaces Askeet). Apparently, all the new functionalities they added in v1.1 and 1.2 look very strong and robust.
Symfony works only with PHP5, which is a huge advantage. PHP4-compatibility equals bad code and less cool features.
You should take another look at Zend (as suggested above). About 6 months ago I went through the same process as you. I eventually chose CakePHP, which I feel fairly fluent in at this point in time. However, Cake is definitely bloated (check out Paul Jones' very recent benchmark article on speed at http://paul-m-jones.com/?p=421).
My next step is either to learn Python or the Zend Framework. I think ZF is probably the way to go -- they dominate the PHP conferences. I was at ZendCon last year (granted, it's sponsored by the company in question), and the ZF guys were really pumped about their framework. And most of them had started on one of the other major frameworks.
That said, Cake has been very instructive (if rather frustrating at times) as an introduction to an MVC framework. I can't say that I regret my time using it.
HTH, Travis
I would go for the simpler frameworks. I used both Symfony and CodeIgniter, and if you have limited time, you really want something that is simple and works. Symfony may surprise you in some places. Of course then you can learn the more complex ones, but the question is if you really need this.
You may also want to investigate Zend Framework and EZ components. They are a kind of different, but also worthwile to learn.
Forget frameworks. PHP development doesn't need them. Just code in a OO MVC fashion without the overhead.
Whenever I run into a neck and neck decision like this, I just choose the most popular one [1]. It usually has the most community support, and is most actively developed. Any inadequacies are usually resolved quickly.
[1] http://www.google.com/trends?q=Symfony%2C+CakePHP%2C+CodeIgniterI have build a large (German) site in CakePHP (http://platinnetz.de). It was an easy start, but as soon as we got into MySQL master/slave, elaborate caching, more complex database layout the ease of CakePHP started to break down fast.
I've come to hate it for these reasons:
Lately, I have implemented some pet projects using my own, very simple MVC framework [1]. I would say for personal projects this is fair. You really don't need much to route clean URLs to an action method in a controller class. The lack of learning curve and matching to your personal coding style totally makes up for the often unused features of bigger frameworks.
For a bigger project, I am currently looking at Kohana [2] which is a fork and more modern rewrite of codeIgniter.
If your project is more editorially oriented, by all means also look at Drupal [3] not only as a content management system but as a very capable, well documented PHP framework with the best developers' and users' community.
[1] http://contenite.googlecode.comI guess I'd start with the question "how complicated is your project?" Look at other projects of similar size and complexity using CodeIgnitor and see how they've worked out. My tendancy is usually to go with the simplest and easiest platform that meets my requirements, and that's almost never let me down over my many years of software development.
My vote goes to CakePHP. I have been using it for about 2 years now, and I always have been able to do what I want to do with it. It was pretty easy to pick up even with no previous MVC experience and the documentation to me was very good and keeps improving. Whenever I don't understand something there are always great examples on book.cakephp.org or if I need to know more about a specific method I use api.cakephp.org. The bakery has also been helpful for things like an fckeditor plugin, or pagination (before it was built-in). The community is very helpful on google groups and IRC and the code finally feels stable with the new 1.2 release.
All things considered, I think the balance of features and short learning curve for cakephp makes it the best choice. Another thing to keep in mind is that you can use parts of the Zend Framework in the three frameworks you mentioned.
I suggest learning more about MVC architecture and studying it first before delving into any of the above frameworks.
Then once you've mastered the concept, try to understand behind the code, why there is this code in the controller, or in the model and then the view.
this way you get to pick up the similarities between each framework and decide for yourself which gets you up and running faster than the others.
cakePHP is the most popular, however I find Code Igniter easier to use as it's very very flexible and doesn't seem to have as much conventions as Cake, except the MVC pattern of design.
I think Symfony fits nice when you need to create a rich backend layer, due to its form generation functionality (which is tied to the underlying orm, Doctrine or Propel). However, customizing the generated forms to fit your needs does seem overly complicated, especially if you are working with a large database.
Additionaly, Symfony poses a certain development workflow, which feels more constrained than working with CI or Zend. Things get really messy, especially if you're tied to a legacy database.
On the other hand, you can easily integrate Doctrine ORM with CodeIgniter [1] or Zend [2], and have a solid ORM tool integrated with a lighter mvc framework.
Personally, I would suggest that you first take a look at Doctrine ORM [3], that is if you need an ActiceRecord object-relational mapper with code-generation, easy configuration (yaml), i18n, migrations and table inheritance, and then use it with CodeIgniter, which has a small learning curve and decent documentation.
Zend is more feature complete than CI, but I have only used its Rest Server module, which CI lacks (among other things).
[1] http://www.doctrine-project.org/documentation/cookbook/1_0/en/code-igniter-and-doctrineRasmus doesn't endorse the usage of frameworks and has some good points [1]. I think their use is ok when dealing with medium websites/ applications that require a common standard of developing for a relative big team of programmers. In terms of performance the usage of a framework will always cost some extra resources.
[1] http://www.sitepoint.com/blogs/2008/08/29/rasmus-lerdorf-php-frameworks-think-again/My 2c:
When I needed an RAD framework for PHP5 I immediately looked towards Symfony. I even bought the book. But I struggled for about a week to get it running smoothly and even then I couldn't easily squeeze out the behaviour I wanted.
Then one day I just got so frustrated that I wanted to try something else. I'd seen CakePHP recommended by Jon Snook and decided to give it a shot. 1 hour later I've got the bones of the app I've been struggling with for weeks. No kidding.
I don't mean to completely slate Symfony here though, there were reasons I picked them in the first place - and it would have been superior if it'd worked. But the documentation was weak (even the book), the installation in unnecessarily obtuse and some of the functionality seemed buggy.
If I'm going to offer one piece of advice, it'll be to not waste time trying to coax something awkward into life. Good luck!
Its very easy to decide which framework is favored. Check the posts number next to each tag in StackOverflow. The more popular a framework the more help you can get. Right now : cakephp × 68 symfony × 21 codeigniter x 60
So Cake is my recommendation to you.
Shameless plug for my own framework, but it's ideal for prototyping while you defer the final decision:
http://code.google.com/p/barebonesmvc-php/
Btw, I used this to develop (several iterations of) the web UI for an embedded consumer device for Cisco; being 60 lines long was a real advantage given the extremely limited space on the device, and for this purpose I never had any intention of moving to another framework.
That being said, if you expect any sort of significant load on your application, avoid Symfony like the plague. I saw this used at a startup on 2 high profile projects that went down in flames; with a dozen or more people laid off in the following several months due to the loss of business. I profiled those applications, and in one instance it took tens of thousands, and in the other hundreds of thousands, of function calls to resolve the initial page. It is full of useless functions (e.g. checking for source code management system files) that in some instances get called once for every single directory of your source code, on every single request. In order to program our way around this issue we would have had to modify core Symfony source code files as it does not adhere to the "open to extension, closed to modification" principle. It does not conform to "program to the interface" and indeed I don't believe it onces uses PHP's "interface" construct. It's a complete disaster.
I would say that you should spend a little time with each and choose the one you can achieve the most with. Quick results in a personal project are essential! The most important thing in a personal project is to finish it. Seeing results not only helps you keep the motivation but it also helps you evaluating the design of your application. The best way to decide whether an app is usable or not is to actually use it :) The ease of development can be a factor in professional projects and useless features often survive just because they were written in an over complicated way. Early mistakes are real motivation killers if they lead to big rewrites, in personal projects this usually means the end of the project itself. So get it running as quick as you can, if it works and you find it has a future you can always optimize. I use cake, because I worked with it before, but if I were to start from scratch and have no previous knowledge, I would choose CodeIgniter.