PHP Application Framework Battle Royale: CodeIgniter vs. Symfony
I found CodeIgniter yesterday and it looks really promising for a php framework. It’s very similar to Symfony but its geared towards the shared hosting crowd who wants a framework that can work with them a little better (or at all). I worked with Symfony about a year ago on a project called MeetFish and it was really cool to see how rapidly we developed the site using a framework (the awesome programmers at Agathon were the real code masters here while I did the design and a little view coding). I’ve always wanted to use Symfony on another project but was never able to because I don’t run a dedicated server and don’t have the time to figure out if it will work in my shared hosting environment. Basically, if I can’t install it in under 30 minutes, I can’t use it.
This is where CodeIgniter comes in. They claim that the framework works in shared hosting environments, and alleviates the need for the command line. In other aspects it looks very much like Symfony or Ruby on Rails but without the fancy command line auto building features (however, it looks like CodeIgniter handles some of this from php script calls).
Here is a one to one “CodeIgniter vs Symfony” comparison:
| Feature | CodeIgniter (1.5.4) | Symfony (1.0.6) |
| Footprint (including docs) | 1.83 MB | 7.84 MB |
| Performance | Never mention tweeking the server for performance enhancements | Mentions tweeking the server, lots of performance inhancements that would be impossible on a shared environment. |
| Server Compatibility | Claims to run in shared hosting environments and up. LAMP Platform Install Page |
From my experience, very difficult to set up if you can’t use PEAR to install and do no run a dedicated server (or do not have root access). LAMP+PEAR+Other PEAR Libraries (Phing,Pake,Creole…these are now bundled with Symfony) Install Page Here and Here. |
| Configuration | one primary config file | lots of config settings |
| Command Line use | no command line interface | cool command line interface to set up projects, scaffolding, crud, etc |
| Libraries | written to be loosely coupled | Depenent on some libraries as mentioned above |
| Documentation | I am very impressed with the documentation on both sides. Symfony has more, but it is a much larger project. Symfony has more tutorials and they are better, and symfony has a book |
|
| Simple Templating | both use PHP mixed with helper functions/classes | |
| Helper Functions | yes | yes |
| Cache management | yes | yes |
| Smart URLs | yes | yes |
| Scaffolding | yes | yes |
| Multilingualism and I18N support | Uses Language Files | Sophisticated i18n internationalization |
| Programming Structure | both are MVC models | |
| Ajax support | can be integrated | supports natively, and is really cool |
Overall, Symfony is more sophisticated (ie. harder to use) while CodeIgniter seems more geared to my level of programming and environment. Symfony might be good for you if you live in code day in and day out, and have a dedicated server, but if not, give CodeIgniter a try. I’ll report back after I do some real tests with CodeIgniter to give my honest opinion about how it works.




Comment by Ville
on 08 Sep 2007 at 2:12 am #
Thanks for that comparison; it was very useful!
Comment by Kumar
on 20 Sep 2007 at 10:43 am #
Thanks for this article; it is really helpful. Here is my two cents from a learners point of view….
I am in the process of choosing a PHP framework for our project. I have looked at many and narrowed down to Cake PHP, symfony, Code Igniter (CI) and Zend Framework due to the availability of clear documents. Then I narrowed it down to symfony and CI due their better documents.
Amongst these four, symfony has by far the best documents. They have very good tutorials, “the book”, class library documents and even user contributed cheat sheets. But, boy the learning curve for symfony is so steep; symfony has so much conventions and configurations that it will take a lot of time before you could design your project.
On the other hand, CI is so simple and intuitive that make up for their lack of detailed tutorials (they have a couple of decent screen cast tutorials). I read the documentation in a couple of days (at my pace - maybe more experienced programmers can do much faster than me) and started the design for the project.
Compared to symfony, CI seems to lack some essential features that are inbuilt in symfony: page level security based on the user role, auto generated forms with search filters and validations, AJAX and layouts for the view. You need to develop your own login, security mechanism, form error handling (you could use CI form and validation helpers though) in CI. In CI, each view is sent to the browser by itself as opposed symfony which has layouts, templates, page fragments, slots, etc so you can easily create a site with multiple segments; so in CI, you need to develop a layout structure for the view so the common parts of the webpage are seperated. There are some user contributed articles in CI wiki to help you with this though.
Now, I seem to lean more towards CI for its simplicity. But it means I have to do more coding and integration of third party Ajax tools myself.
From performance side, I felt symfony is a bit slower compared to CI for the same task of displaying a few rows from the database.
Comment by HITEC
on 13 Oct 2007 at 7:52 am #
Thank for all! it is really helpful for me.
I use CI and integrate Smarty for template, prototype for ajax, javascript and tinymce for HTML editor. I think that anough.
Comment by aboyon
on 04 Nov 2007 at 7:47 pm #
good comparison, i choice codeigniter, is easier than simfony.
Last month i was testing cakePHP & simfony and sudendly i see codeigniter and i said “it is what im looking for”..
well thanks soo much again by your comparison…
greetings! and God Bless you
Comment by Stu
on 06 Nov 2007 at 3:00 pm #
Great table. I like simple as long as you are not losing anything in the mix. Also we do a lot of CodeIgniter sites with very advanced Ajax without any problems.
Comment by gillbates
on 20 Nov 2007 at 12:40 am #
I’m building a site in symfony right now, and learning it in the process. I just took a quick look at codeigniter’s documentation, and I can immediately tell that codeigniter would be so much easier to learn. If you’ve never used CI or Symfony before and you need your app finished yesterday, I suggest CI.
That said, if you can take time to study and learn, I suggest symfony
Comment by Ian Clifton
on 21 Dec 2007 at 8:22 pm #
These are really two very different frameworks. If you are doing a massive project, particularly one that needs to scale well, symfony is the answer. If you’re making a personal site and looking to have some nice libraries while organizing your code, CodeIgniter is the way to go. Anything in between just depends. CodeIgniter is extremely easy to learn because it is so intuitive, but it is also much smaller and less feature-rich. symfony is the exact opposite: tough learning curve but features galore. I’ve run both on shared and dedicated servers. Though symfony can run on a dedicated server, I don’t recommend it (it’s slightly better if you do your developing and testing on your own box, but still pretty resource-intensive).
Comment by Benben
on 01 Feb 2008 at 4:15 am #
I’ve recently released my website built with symfony on a shared host (no command line access, and no pear) and it worked perfectly fine.
The guys at symfony recently (about 8 months ago) created a simple command line to pack all the required library in your project folder so that deployment on the shared host only becomes a matter of uploading the files.
I think they were aware that shared host deployment was a weak point of their framework and addressed the issue quite well (to my experience).
Note that i never programmed anything in PHP prior to doing that website, but since i’m used to object programming I did find the symfony approach quite natural.
Comment by BorisK
on 14 Apr 2008 at 7:28 pm #
Expression Engine 2, which is due this summer, will sit on top of CodeIgniter. EE is compared to Movable Type more than often. Having such a great product would bring many people over to CI.
Comment by pitrasacha
on 27 May 2008 at 12:14 am #
hey .. nice comparasion ..
FYI : symfony running well in shared hosting
just use the symfony freeze command, everything done
Comment by James Ehly
on 27 May 2008 at 10:59 am #
I have heard that people are running newer versions of symfony on shared hosts. This is pretty exciting and I hope to have time to test it out.
I’ll take this into consideration, I’ll update the post once I get a chance to test it.
Comment by ken
on 30 Jun 2008 at 11:08 pm #
using symfony in a shared environment is just a matter of freezing, uploading and modifying include paths in the front controllers, very easy
Comment by application
on 30 Jul 2008 at 8:01 pm #
He failed to mention that Codeigniter trumps over Symphony on:
Learning curve
Ease of deployment
Flexibility of hosting environments
PHP syntax even if it’s off in your PHP config
Lack of extraneous garbage
Speed of creation
non-overgrown documentation just for the sake of being large
Comment by halwaraj
on 03 Oct 2008 at 10:59 am #
Hey good man, you resolved alot of my issues. Thanks. Namaskara maga.
Comment by Connor Denman
on 11 Nov 2008 at 1:03 pm #
I find Symfony to be a powerful framework, even though I like codeigniter better and I use CI for most of my projects. Although, I find Symfony’s data schema.xml thing very unproductive and just plain unnecessary. Codeigniter has many good and bad features just like Symfony, but CI gives the developer more freedom (not taking over the whole application), so that they can create as simple or advanced of a web application as they want.
Comment by mikemike
on 11 Nov 2008 at 7:20 pm #
Code Igniter rocks. It’s so light weight, and it’s the easiest frameworkto learn in any language period. There are very few issues with compatibility anywhere ever on any hosting environment, and when there are, you just google the error code, or google site:codeigniter.com example error and you’ll find a fix instantly. I had a problem with my clean URLs not working correctly on Media Temple hosting (Because of their weird Apache configuration), and I found the fix in like 3 minutes.