News for hackers. Stuff that matters.

Ask HN: Best PHP Framework for Web Development

I have been working with PHP for almost a year now. And I m quite familiar with the language. So I was thinking to start using a framework for my next project.

I m actually really confused as there are so many good frameworks with such good features with docs & extensions. I m really actually looking for a decent framework which is really easy to use. I ve considered Yii, Zend, CakePHP.

Would like to know about your experiences about these frameworks!

( 20 comments | 6 points | on HN )
Re:Ask HN: Best PHP Framework for Web Development by MattBearman on Friday May 11, 2012 @03:09PM (#3960789)
For starting out I'd definitely recommend CodeIgniter (http://codeigniter.com) simply because the documentation is second to none.

Since learning CodeIgniter I've tried CakePHP and Zend, and found CodeIgniter is easier to use, and just as powerful, so I've stuck with it. In fact the BugMuncher (http://bugmuncher.com) back end & API is built on my custom version of CodeIgniter

Also check out the datamapper ORM plugin (http://datamapper.wanwizard.eu/) if you want Rails-like Active Record goodness.

Re:Ask HN: Best PHP Framework for Web Development by gchucky on Friday May 11, 2012 @07:39PM (#3962001)
Until recently at work we've use Symfony1. It's going to end of life at the end of this year, and I think we're going to shy away from Symfony2 for now. It's a bit of a mess, I think, and it seems like they're going to correct a bunch of things in 2.1, but that won't be out for a few months. We'll probably reevaluate after that.

Our other goto framework is Cake. People do have a lot of good/bad things to say about Cake, but I rather like Cake 2. It's a little more mature now, and I don't really think it's as hugely complex as Symfony.

I use Zend on my own, but I'm becoming disillusioned with it. It seems to be overengineered and, after using Doctrine for as long as I have, its modeling leaves a lot to be desired.

Recently I've been researching FuelPHP (http://fuelphp.com/) and it seems to have potential. It's a little better designed than CodeIgniter and its ORM seems interesting.

Hope that helps.

Re:Ask HN: Best PHP Framework for Web Development by mootothemax on Friday May 11, 2012 @12:23PM (#3959974)
I favour Kohana (http://kohanaframework.org/). Very quick and easy to get the core of your app built. Only (and potentially major) downside is that the documentation can be tricky to wade through.

I'd run away from CakePHP. Caveat: last version I worked with was 1.3. The weird way it uses arrays in its ORM to kinda-sorta-but-not-quite work on the database always hurts my head. In fact, the whole way of going about things in CakePHP hurts my head.

Re:Ask HN: Best PHP Framework for Web Development by gyardley on Friday May 11, 2012 @01:10PM (#3960212)
Agreed.

Kohana's tutorials are pretty bad, but the API browser is solid and the code of the framework itself is very readable.

As a beginner, having to dig under the hood of Kohana to fully understand it initially turned me off, but I came away with a much better understanding of how MVC frameworks work.

Re:Ask HN: Best PHP Framework for Web Development by trevelyan on Saturday May 12, 2012 @05:03AM (#3963278)
I've never had any problem with CakePHP and am curious what you mean.
Re:Ask HN: Best PHP Framework for Web Development by debacle on Friday May 11, 2012 @11:37AM (#3959738)
I would start with Silex. It's a very small framework, pretty well written, and very easy to pick up:

http://silex.sensiolabs.org/

It's also supported by Sensio, who has a good track record. I'd pick it over Symfony because it's more lightweight and over Kohana or CI because it has better documentation.

Cake will lead you down a dark path, and ZF is bloated and unwieldy. Yii seems nice, but I think they lack direction.

Re:Ask HN: Best PHP Framework for Web Development by AjJi on Friday May 11, 2012 @11:58AM (#3959859)
>Cake will lead you down a dark path

Why is that?

Re:Ask HN: Best PHP Framework for Web Development by polyfractal on Friday May 11, 2012 @10:29AM (#3959335)
I don't think it matters too much when starting out. For a beginner (in the framework, not coding in general), they are all relatively equivalent.

Pick a framework and begin using it. After a few projects, you'll quickly learn what you like and don't like about the framework.

I'm a fan of CodeIgniter, but mostly because it is what I'm familiar with. It has some irritations and kludgy things required, but they don't annoy me enough to warrant a change (yet).

Re:Ask HN: Best PHP Framework for Web Development by dirkdeman on Saturday May 12, 2012 @05:28AM (#3963337)
I tried a couple of them and sticked with CodeIgniter. Sure it has some quirks, but it's powerful, easy to grasp, not bloated (hello, Zend!) and more than capable to satisfy your web dev needs. Plus it has a great community and lots of tutorials. But really, my advice is to spend a day or two trying several of them out. Create a simple project with each of them (the ubiquitous blog for exampe) and see what works for you. Good luck!
Re:Ask HN: Best PHP Framework for Web Development by kaolinite on Friday May 11, 2012 @09:35AM (#3959091)
Zend Framework is the traditional 'enterprise' framework, you won't go wrong with it, though there are quite possibly better alternatives. That's what we use where I work.

I've heard very good things about Kohana but don't have much experience with it. Just try and pick something with a good set of documentation and a decent community.

Re:Ask HN: Best PHP Framework for Web Development by vanwilder77 on Friday May 11, 2012 @09:47AM (#3959148)
Sure !! And well thats the confusing thing for me.

Every framework comes with some pros and cons and it is really tricky to decide which framework to go with.

Re:Ask HN: Best PHP Framework for Web Development by kaolinite on Friday May 11, 2012 @12:24PM (#3959980)
I think in that case Zend Framework might be a good choice. It may not be the sexiest framework but it's developed and supported by Zend, the company behind PHP. It isn't going to fade away any time soon and there's tonnes of support and advice around.
Re:Ask HN: Best PHP Framework for Web Development by jaz on Friday May 11, 2012 @01:27PM (#3960295)
Another nice thing is that Zend Studio is pretty tightly integrated with Zend Framework. It's particularly nice when you're dealing with large ZF projects.
Re:Ask HN: Best PHP Framework for Web Development by LarryMade on Friday May 11, 2012 @10:44AM (#3959425)
Depending on what you do your mileage may vary.

What I was doing didn't fit in with what the then current frameworks offered - so I made my own... and that's how all those frameworks got their start as well.

My suggestion is to look at the various framework features and see which one best suits your needs.

Re:Ask HN: Best PHP Framework for Web Development by twog on Monday May 14, 2012 @12:32PM (#3971780)
If you're looking for a modern framework, I would recommend http://fuelphp.com. It doesnt have the size of community that a codeigniter or cakephp will have, but it leverages a lot of the great MVC framework features that Rails launches with.
Re:Ask HN: Best PHP Framework for Web Development by bonsai on Saturday May 19, 2012 @05:10AM (#3995533)
Have you considered Symfony 2 http://symfony.com/?
Re:Ask HN: Best PHP Framework for Web Development by petervandijck on Thursday May 24, 2012 @08:03PM (#4021232)
http://laravel.com/ looks very promising
Re:Ask HN: Best PHP Framework for Web Development by Kmanicka on Sunday May 13, 2012 @11:38AM (#3967250)
this blog post seems to cover this topic well http://davidjconnelly.wordpress.com/2011/07/03/the-best-php-...
Re:Ask HN: Best PHP Framework for Web Development by rmATinnovafy on Saturday May 12, 2012 @01:05PM (#3964466)
I've been working with Slim and it is pretty good.
Re:Ask HN: Best PHP Framework for Web Development by Canada on Friday May 18, 2012 @11:31PM (#3995026)
Yii