InfoWorld review: Fabulous PHP frameworks

Zend Framework, Symfony, CodeIgniter, CakePHP, and other PHP frameworks conquer Web development with extensive features, powerful tools, and superior ease

The website development world is not ruled exclusively by PHP, but PHP's extensive use as a Web development language is undeniable. Although good statistics are difficult to come by, the trends.builtwith.com site places PHP's Web-wide use at approximately 35 percent -- first among Web development languages and platforms.

Consequently, it would be reasonable for a developer embarking on a new website construction project to select PHP as the site's primary building material. It would not be reasonable, however, for that developer to assemble the project from scratch. A PHP-based website usually requires more than PHP code. There's HTML for the page layout, CSS for its style, SQL for its back-end database, and JavaScript for client-side responsiveness. That's quite a fray to jump into unarmed.

Happily, you can arm yourself with one of the PHP-based Web development frameworks covered in this article. In the following pages, I'll look closely at the Zend Framework, CodeIgniter, CakePHP, and Symfony. I'll also give quick overviews of Qcodo, Lithium, Seagull, and Yii. All are open source frameworks, and all implement to one degree or another the MVC (model view controller) architecture pattern. In addition, all purport to help you build a more scalable and more easily maintainable Web application than you could otherwise create from scratch and, most importantly, do so in less time.

Meet the frameworks

The principal goal of these PHP frameworks is to accelerate the construction of Web applications. But some claim abilities beyond Web development. For example, you can use the Seagull framework to build command-line and GUI applications as well as Web applications. Although all the frameworks support the MVC design pattern, not all lock you into it. CodeIgniter's documentation, for example, states explicitly that applications may, if need be, employ only that framework's controller components.

Support for JavaScript and AJAX varies. Qcodo integrates JavaScript almost seamlessly; a single alteration to a control's action-handler method in Qcodo will change that control from being PHP-based to AJAX-based. Most other frameworks provide support for popular JavaScript libraries such as jQuery and Dojo. Lithium's JavaScript support is minimal; rather than support JavaScript directly, Lithium provides conversion of requests/responses to JSON (JavaScript Object Notation) for easy JavaScript manipulation.

Zend and Symfony are feature-rich frameworks brimming with packages covering a variety of technologies. For example, Zend's Zend_SOAP and Zend_XMLRPC packages encapsulate just about everything you need to build RPC-style SOAP server and client applications. Both Zend and Symfony, however, demand significant learning time as compared to the other frameworks reviewed here. In particular, learning Symfony requires learning YAML (Yet Another Markup Language), which Symfony employs extensively for configuration and data description.

Although garnering smaller followings, both Yii and Seagull are also worth exploring if you need to build large-scale Web applications. Yii is particularly well suited for constructing database-backed websites; Yii's command-line tools will generate the source for a CRUD (create, read, update, and delete) interface. Seagull's module system provides prepackaged application components like a guestbook, newslettter, FAQ system, and more -- ready to install and use.

Meanwhile, if you want to get your application off the ground quickly, take a look at CodeIgniter. It requires zero configuration, and installation is as simple as unpacking an archive into your webroot. Although CodeIgniter's feature set is humbler than Zend's, it does provide libraries for such things as image manipulation, email, file uploading, and more. And nothing stops you from beginning an application in CodeIgniter, then attaching Zend packages for additional features as needed.

Finally, CakePHP artfully treads the line between the large and the small. As with CodeIgniter, CakePHP applications require minimal configuration. With an excellent set of automation tools, ease of installation, an online cookbook, and vigorous community support, it's no wonder CakePHP is so well regarded by its users.

PHP smorgasbord

Which to choose? If you need a large library of functionality to draw on, then Zend framework and Symfony are good choices. On the other hand, if you want to hit the ground running and get your Web application airborne quickly, you'll probably want to look at CodeIgniter or Qcodo.

Even so, the other frameworks have much to recommend them. CakePHP has a large and devoted community of users. Seagull and Yii provide libraries replete with ready-to-drop-in code. And Lithium's lightweight architecture will be attractive to developers who prefer trim design instead of features they'll never use.

Recommending a single framework as the hands-down choice is simply impossible; there is too much overlap among the frameworks' capabilities. None is clearly superior to the rest. Choose whichever offers features that most closely match your project's requirements, and dive in. You'll get plenty of help along the way.

Compare PHP framework features:

Read the reviews:

Also on InfoWorld:

This article, "InfoWorld review: Fabulous PHP frameworks," was originally published at InfoWorld.com. Follow the latest news in software development and PHP at InfoWorld.com. For the latest business technology news, follow InfoWorld.com on Twitter.

Table continues next page

PHP frameworks at a glance

 Minimum PHP versionLicensingDocumentationPros and cons
CakePHP 4.3.2 MIT API; online user guide (CookBook) includes tutorials.
  • + Easy-to-use command-line tools
  • + Excellent documentation
  • - Strict naming conventions
  • - Fewer extensions than larger frameworks
CodeIgniter 4.3.2 Apache/BSD User guide; video tutorials; links to numerous offsite tutorials.
  • + Quick and easy installation
  • + Flexible; no "forced" conventions
  • - Limited features compared to others
  • - Currently no JavaScript support
Symfony 5.2.4 MIT Getting Started guide; online books; tutorials; reference guide.
  • + Well-established framework in widespread use
  • + Extensive feature set
  • - Long learning curve
  • - Requires understanding of YAML
Zend Framework 5.2.4 New BSD API; reference guide; quick-start guide; numerous "Getting started with…" items in the reference guide; webinars.
  • +Comprehensive feature set
  • + Other frameworks actually recommend using Zend components
  • - In danger of feature creep
  • - Long learning curve
Lithium 5.3 BSD Brief tutorial; some user guides (but for technologies other than Lithium); browsable API. Much of the documentation is still under construction.  Not evaluated
Qcodo 5.1.2 MIT API documentation and "cheat sheet"; coding examples; getting-started guide under development.  Not evaluated
Seagull 4.3 BSD API documentation; how-to/user guide in the form of a wiki.  Not evaluated
Yii 5.1.0 BSD Getting-started guide; tutorials ("A Definitive Guide to Yii" is an online book); class reference; screencast demos.  Not evaluated

Table continues next page

PHP frameworks at a glance, continued

 Databases supportedJavaScript supportCaching supportDebuggingWeb service development support *
CakePHP ADOdb, Firebird, Microsoft SQL Server , MySQL, ODBC, Oracle, PostgreSQL, SQLite Yes (Prototype and script.aculo.us) Yes (a cache helper) Debug class for dumping variables, logging, and tracing. Yes
CodeIgniter Microsoft SQL Server, MySQL, ODBC, Oracle, PostgreSQL, SQLite Experimental support in the development branch. Yes Can enable profiling on the output class (which can be used for debugging). Also has logging ability. Partial (an XML-RPC helper class)
Symfony MySQL, PDO, PostgreSQL, SQLite Yes Yes Extensive debugging support. Not directly. For SOAP/WSDL, use PHP native for SOAP and Zend Framework for auto-discovery.
Zend Framework Firebird, IBM DB2, Microsoft SQL Server, MySQL, Oracle, PostgreSQL, SQLite Yes (classes for Dojo and jQuery) Yes Includes a logging class and a debug class for dumping variables. Yes
Lithium Microsoft SQL Server, MySQL, PostgreSQL, SQLite, MongoDB, CouchDB Indirectly (embedded markup and conversion to JSON helps manipulation with JavaScript) Yes Yes Not directly
Qcodo Microsoft SQL Server, MySQL, PostgreSQL, SQLite Yes Only internally (no HTML caching) Partial (includes logging and exception-catching capabilities) Yes
Seagull Any database supported by PEAR::DB Yes (AJAX provider class) Yes Yes (can override PHP's standard error handling) Yes
Yii Any PDO-supported database Yes (jQuery integration) Yes Yes Yes

* Note: Web service support refers to SOAP/WSDL. Most frameworks will support RESTful Web services directly.

This story, "InfoWorld review: Fabulous PHP frameworks" was originally published by InfoWorld.