views:

5462

answers:

22

OK, sorry in advance for the length of this question!

I've spent ages reading about the pros and cons of all the major PHP Frameworks (i.e. Zend, CakePHP, Symfony, CodeIgniter, 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 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:

  • Symfony
  • CakePHP
  • CodeIgniter

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 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?

+3  A: 

I 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.

Ogre Psalm33
It's probably a mid size project. We're building an app which would be similar to mantis or fogbugz (bug tracking) but with a different slant to it. It's prob going to have an external API aswell (which is why the askeet tutorial looked nice!)
Ed Bloom
+4  A: 

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.

phjr
Thanks, I've looked at both Zend and EZ components. I'm looking for something with a bit more structure. I know other more experience php developers would probably prefer the flexibility but I do like having something with a bit more convention driven.Thanks for the feedback
Ed Bloom
+12  A: 

A 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.

Joeri Sebrechts
Hi Joen, very good point - symfony has some very nice Ajax library integration which also appeals to me - looks like I'm trying to convince myself to do this the hard way!
Ed Bloom
I'd agree. The more '2.0' it is the more you will rely on JS. I messed around with all three you are considering, but realized that the PHP would be doing little more than queries, validating input, and sending JSON so I rolled my own.
Chris Kloberdanz
The nice thing about Zend Framework is that it helps you implement web services, database queries, and so on, without requiring you to buy into their MVC paradigm.
Joeri Sebrechts
+25  A: 

[edit] August 2010: 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.

September 2009: 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.[/edit]


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, this and this) 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 strenghts 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 to 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 scarry 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...

Temporary Answer

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.

tharkun
ha ha tharkun - it's like you are reading my mind with your thought process which you just described! I ruled out Zend for the moment because I see it more like a pear like library based framework at the moment but it does look promising
Ed Bloom
Who rants about CakePHP's documentation? When I first made the dive into CakePHP their documentation is what got me through. It's not amazing but it is hardly against it.
Paolo Bergantino
"At the moment I am using cakephp [...]But I am getting a bit fed up [...] mostly because of a lack in documentation and community support." written by cdamian"The drawback of Cake is that it's documentation is lacking[...] " written by tyshowk
tharkun
Their documentation is pretty good and their IRC channel is packed with knowledgeable people...
Paolo Bergantino
+1 on the points about CakePHP. Been using it lately and community support is about as abrasive as the online docs. You inspire me to check out Zend Framework.
spoulson
I think more and more that it's worth using ZF!
tharkun
+7  A: 

I already post a question about Symfony 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,

Daok
thanks Daok, that's really useful information - i didn't realise the askeet tutorial was out of date - which was one of what I thought was a really strong point for an intro to symfony....
Ed Bloom
I know how you feel because it was a strong point for me too :(
Pokus
There is a tutorial very similar to the Askeet one, but for symfony 1.2, which is the lastest version, called Jobeet. It's on http://www.symfony-project.org/jobeet/1_2/Propel/en/, but the demo site is not working.
NachoCual
I have used CodeIgniter and Symfony and advise enterprise level users to take a good look at Symfony. CodeIgniter is excellent for small projects though.
Jon Winstanley
+9  A: 

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!

Ed Bloom
CodeIgniter is a wonderful framework and a great place to start. Build a few projects, then, when you feel more comfortable with MVC etc, download the Symfony book and make the move up to an enterprise level PHP framework.
Jon Winstanley
Don't rule out Symfony for such a small issue. It has some incredible features and is worth a second look. The instant back office generator is amazing. Plus, you can create a database schema in YAML or XML, and have Symfony create you a CRUD app in about 10 minutes.Anyway, Jobeet is their new tutorial for Symfony v1.2
Jon Winstanley
Speaking of my experience with Cake, being able to create a CRUD app in 10 minutes is not really a mark of how good the framework is, it just means that now you have to polish the app until it's usable. Sure, I just made a blog. Guess what: crude blogs are two a penny. Cake is great, but it takes time learning it.
Adriano Varoli Piazza
A: 

Did you have a look at SilverStrype / Sapphire? They just won the "most promising open source CMS Award".

I'm checking it out now and it looks like a good framework extended with a very flexible light CMS.

EDIT: As a test I will realise my next project with SilverStripe/Sapphire because their logics sound really good to me. EDIT END

Plus I finally found a web application framework comparison matrix which is far from complete but we can all contribute to make it better.

tharkun
Their website is unclear whether they have a SilverStrype CMS, or a SilverStrype Framework. It's got mostly tech jargon and buzzwords I find, rather than helpful information.
The Wicked Flea
then you haven't had a thorough look at the site indeed! SilverStripe is the CMS and Sapphire is the Framework on which the CMS is built and on which users can build their own modules, etc.
tharkun
+1  A: 

Would you comment on why you have chosen not to use Zend Framework? I appreciate everyone has different requirements, I just wonder why ZF was ruled out?

Andrew

Andrew Taylor
+1  A: 

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.

+5  A: 

Hi, One 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.

saadou
+1  A: 

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!

Tom Wright
A: 

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.

Nir
The numbers are all wrong by now and you're leaving out Zend Framework which has more posts than Cake. Plus I think your approach is illogical. More posts can also mean that the technology in question is harder to get, has worse documentation, etc.
tharkun
+1  A: 

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.

George Jempty
+5  A: 

Forget frameworks. PHP development doesn't need them. Just code in a OO MVC fashion without the overhead.

+1 No better way to learn than to do...
spoulson
Gives you a LOT more work though. I'd always use a framework so I don't need to re-code authentication/url rewriting/object relational mapping.
Jon Winstanley
I agree that it's a great way to learn, but why start from scratch every time you want to build something? Sucks the fun if you ask me.
Tom Wright
That's a poor advice in my opinion. There is no need to invent a wheel in every project again and again.
FractalizeR
-1 not a good answer, not reusing code is very expensive.
Kugel
ant p hasnt coded big projects before =)
never_had_a_name
+2  A: 

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 or Zend, 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, 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).

+5  A: 

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

Travis Leleu
A: 

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.

jimiyash
+2  A: 

Symfony works only with PHP5, which is a huge advantage. PHP4-compatibility equals bad code and less cool features.

laurentb
+10  A: 

My 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.

dr Hannibal Lecter
A: 

Whenever I run into a neck and neck decision like this, I just choose the most popular one. It usually has the most community support, and is most actively developed. Any inadequacies are usually resolved quickly.

Mark
This is an interesting way to choose, I need to remember this. However, as seen from the answers here, the contenders are close enough to each other that for this question the popularity alone does not really help. Also, funny enough, if you add a popular Content Management Framework, eg. Drupal ( http://www.google.com/trends?q=Symfony,CakePHP,CodeIgniter,Drupal ), the "pure" MVC frameworks are dwarfed by a large margin.
Olav
+1  A: 

I 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:

  • it reinvents basic PHP concepts like $GET, $SESSION, has poor support for HTML forms
  • it has poor support for bulding large sites with the features mentioned above
  • as a very subjective point, I dislike CakePHP's overly complex and - to me - unintuitive singular/plural & camelCase conventions.
  • there is virtually no regional developers' community in Europe. Coming from Drupal, I must admit I am spoiled.

Lately, I have implemented some pet projects using my own, very simple MVC framework. 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 which is a fork and more modern rewrite of codeIgniter.

If your project is more editorially oriented, by all means also look at Drupal not only as a content management system but as a very capable, well documented PHP framework with the best developers' and users' community.

Olav
A: 

Rasmus doesn't endorse the usage of frameworks and has some good points. 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.

Elzo Valugi