By Harry Fuecks

Which PHP libraries do you use?

By Harry Fuecks

For interest, wondering what PHP libraries people use? By use I mean libraries you actually trust and are willing to use / have used on a live website.

To get the ball rolling, some I’ve used before;

Email: phpMailer – 100% happy. Also a great place to help beginners understand the basic purpose of OOP

DB: ADOdb when working with Oracle – the API is much friendlier than the native Oracle extensions

XML-RPC: Incutio XML-RPC Library – the “off the shelf” version has one or two bugs which show up in less common situations but this is one of the most complete and easy-to-use XML-RPC implementations in PHP available, IMO. What I like most is it takes full advantage of PHP’s dynamic nature, rather than needing a ton of glue code to map types.

HTTP client: PEAR::HTTP_Request – there’s one of two things I’d like to fix but in general it’s a workhorse I can live with.

Forms: PEAR::HTML_QuickForm for one-off, standalone scripts. WACT otherwise.

RSS Generation: Manuel Lemos’s RSS Writer

Caching: PEAR::Cache_Lite – when I’m in a hurry. Running it through a profiler though makes me consider writing my own, specific / tuned to a particular problem.

  • Jeffrey Hardy

    I’m with you on phpMailer — I use it everywhere.

    I also use ezSQL a fair bit, but lately I’ve been using Creole now that I’m on to php 5.

    I’ve always had good results with ezSQL, and I’m suprised I don’t see it mentioned more often… Anyone have any thoughts on it?

  • Cauliflo

    here is a short list of the useful librairies/extension/design pattern i used in my everyday life of PHP Developper :
    – PEAR::Cache_Lite (for a quick optimization of an existing web site)
    – XDebug (a fantastic time saver for complex, sometimes dirty, unknown site)
    – PEAR::XML_Serializer -> the simpleXML for whose who still can’t use PHP5!!! (almost always used with PEAR::CAche_Lite)
    – Mojavi. Yeah, it’s a framework and not a library but it’s really a very good product!
    – design pattern. Nearly every site i have to develop are based on the following patterns : singleton, factory, dao, proxy, decorator, observer (sometimes)
    – simpleTest for unit testing. Has also a quite good web plug-in for doing little functionnal testing

  • I’m using PEAR::DB, PEAR::HTTP_Request, PEAR::XML_Serializer, XML_Util, patTemplate, patForms and patConfiguration nearly every day. I also use tons of other PEAR packages and I’m happy with most of them.


  • legoxx

    I use jpgraph, and i’m really very happy with it, cache lite can be optimized:-)

  • I use Smarty and PEAR::DB on a regular basis but haven’t lately been doing many projects that require anything other than those, my technorati wrapper, and various custom libraries.

    I had been trying to decide which email package to use lately, though, so I’m going to spend some time with phpmailer.

  • Pascal Van Hecke

    Tons of Pear packages as well, of which DBDataObject I’m really enthousiastic about.

    Feedcreator ( for content syndication (rss, html iframes and javascript).

    Roadsend Sitemanager as a framework to develop web applications.

  • PEAR:DB would be the one I use most of all. FPDF (a class actually) for easy PDF generation instead of PDFLIB aswell.

  • SimeonBeta2

    I’ve made the decision to restrict myself as much as possible to PEAR libs for everyday use, mostly because a single point installer/config is important to me. Most used pear libs in descending order are DB, Cache_Lite, QuickForm, Sigma, Tree and Calendar… Currently am trying to use/learn DataObject and XUL pear libs, but not in use on any production sites yet…

  • PEAR::Db, PEAR::Auth, PHPMailer for me… Planning on starting with RSS sometime soon, bound to be looking for RSS library then (probably start looking somewhere in PEAR)…

  • Nico Edtinger

    I’d trust Adodb, Smarty and PEAR:Mail_mime. They might not be the fastest but work very well if you don’t want to write all the code yourself.


  • josheli

    PHPMailer is good, but has some bugs that appear on high mailing volume sites.

    for RSS i’m using feedcreator:

    i also use Spreadsheet::Excel_Writer.

  • hmm… theres actually not too many…

    I’ve tried using QuickForm and Smarty on ‘big ball of mud’ projects, but probably wouldn’t again…

    Cache_Lite I would definitely use again, and HTMLSax is another library that has been really useful around the place.

    I have my own DB and Form/Element classes which tend to come along for the ride on new PHP projects…

    SimpleTest is definitely the most trusted library that I use frequently, though not really part of a live app itself.

  • sevengraff

    ETS is a great template engine, ADOdb is the fastes for DB abstraction, and I also use phpMailer because it’s so easy and reliable.

  • Aristotle

    I use:

    Savant – template engine

    I used to use Smarty, but it became too bloated for my needs and too hard to use for newbies. Savant is much better as far as simplicity goes, and it is fast too.

    ADOdb – database layer

    Everyone uses this (or at least it seems like it), so I just jumped on the bandwagon. However, I used ezSQL for a while, and I used to use the PHPbb DB class all the time.

    Propel/Creole – database layer (PHP 5)

    Creole is a really nice DB layer for PHP 5 users. It supports many features (such as Prepared Statements) that other DBALs do not. Propel is a related project that aims to make data easy to manipulate by building convenient data access classes from database schema represented in XML. Very nice, once you figure out how it works.

    PHPMailer – mail sender

    Easy, fast, solid…it just works.

    PHP/SWF Charts – Flash chart generator

    This one made my day a few months ago when I first discovered it. Someone has figured out how to dynamically generate beautiful looking Flash graphs and charts using a SWF file’s query string. The PHP code behind it is not very good (it’s all wrapped up in a yucky function), but it works very well. See the galleries at for a good preview of what it does. It blows JPGraph right out of the water, I think.

  • ryansking

    pear stuff: db, db_dataobject, quickform, cache_lite, xml_serializer, config, http_request, http-*

    Savant –

    ..and others.

  • andre

    ADODB, smarty or savant, pear’s spreadsheet excel writer…i’ll give jpspan a try one of these days too :)

  • Claudex

    I use Adodb for DB Stuff (Mysql, Sql server, PostgreSql), phpXPath for XML, R & OS PDF for… pdf, jsrs for interactive RPC.

  • NativeMind

    PEAR SOAP, Log, DB
    mb_string, pgsql extension, curl (used by pear soap), and syslog

  • weierophinney

    The core libraries I use daily are Smarty, PEAR::DB, phpDocumentor, and SimpleTest.

    Also high on my list is PEAR::Pager, though I found that it’s usable only when a
    wrapper class is used to define sane defaults for most items. Now that I’ve dug
    into the PEAR::HTTP_Upload code, I’ve found it to be a very solid piece of work
    that makes doing file uploads incredibly easy. I tend to use in conjunction with

    I authored and maintain
    href=””>Cgiapp.class.php, and this
    is another one I use on a daily basis; it makes developing reusable applications
    incredibly easy (which is important, as we reuse applications across our sites
    where I work, and I hate maintaining code in separate places).

  • Joe W.

    Typo in your link to phpmailer. Should be:

  • I use PEAR:Excelwriter alot, also fpdflib. I guess I’m all about exporting web content to other formats

  • Darchangel

    i use the pear excel spreadsheet writer. i want to use either adodb or ezsql also – i just can’t decide which will be better for our current production environment

  • hanumani

    I have 2 frameworks or package configs:

    Small and Dirty:
    DataObject formbuilder

    DataObjects -> moving to plone
    My own MVC (switching to Seagull, wact is too pure and complicated, I don’t see the benifits yet).
    Smarty -> moving to flexy
    Pear:Auth (although not thrilled with it).

  • arrowhead

    phpMailer for complex email functions, and jpGraph for drawing database-driven charts and graphs.

  • Savant as template engine
    ADOdb for database
    MagpieRSS for RSS parsing

    I see a lot of PEAR being used, but somehow I am just not convinced…

  • phpmailer whenever I need such a thing, smarty on a regular basis, nusoap when I need web services and have no PHP5, trying to stay as far away from PEAR as possible…

  • PHPMyEdit for all my site backends. Great timesaver.

  • Markus Wolff

    Tons of PEAR stuff:

    Those are only the ones I use frequently, there are many others. From outside PEAR, I like jpGraph and have recently taken a look at patForms and Savant, which both seem very cool.

  • PHPMailer I “discovered” about 11 months ago and is absolutely invaluable. We also use PHPLIB for templating and our own wrapper functions around the PEAR DB classes.

  • Tim Strehle

    Some ancient (and slightly improved) classes for e-mail transfer (mime_mail and smtp_class), seems like we should consider switching to PHPMailer – thanks for pointing to it!

    We (seldom) use JPGraph and ADOdb. No PEAR stuff currently.

    For most things (like logging, caching, database connectivity, HTML forms + helper functions, etc.) we have our own set of functions + classes + conventions, making it easy to optimize according to our applications’ needs.

    We love having a “very thin veneer” (see Peter Yared’s essay on “The Next Language”,…

  • Karin van den Berg

    patTemplate ( is my template engine of choice. I’ve also used PEAR:HTML_Template_IT, which works in a reasonably similar fashion. Other than that I’ve used PEAR:HTML_Quickform a couple of times, and PEAR:DB.

  • I use:


  • hlellelid

    * Propel
    * Creole
    * stripped-down Mojavi ported to PHP5.
    * PEAR::Log ported to PHP5.
    * Horde support libs (again, ported to PHP5)

  • Faust

    Eclipse 3.1
    Am I the only one who still uses Eclipse, now EclipseCE? Should I be using ADOdb instead?

    I already know PHP and don’t really want to learn Smarty’s templating language.

    SQL query processer to automate the tedious tasks of syntax testing, injection attack-proofing, dropping parts of queries and other misc features.

  • Gil

    I’m surprised no one has mentioned Eclipse. For OO projects this library has helped me tremendously.

  • Torsten Roehr

    Lots of PEAR libs:
    Calendar, Date, DB, Log, LiveUser, HTTP_Session, HTTP_Download, Validate

  • None!

    I am still a newbie in the scale of things with PHP so I would rather learn it the hard way to ensure that I understand PHP before accepting that a library is what I need. Some of you have written that library-x needs some work or uses a strange functionality: I can neither detect these, nor can I fix them so I would rather not be caught with a library that has a problem I can’t fix.

    Furthermore, my uses for PHP are pretty light and a library would be overkill so I am happy without them so far.

    On the other hand, that PHP/SWF Slideshow is REALLY COOL: I think I will take that for a spin.


  • r0kawa

    ADODB, HTML_QuickForm,QuickForm_Controller PHPMailer, Mail_Mime , Text_BBCodeParser , Image_Transform. I think PEAR is a nice collection of library.

    Smarty is still usable if you just use basic function.

  • texdc

    I still dig the Eclipse Lib, even though Vincent is no longer maintaining it. It’s so simple and elegant that it still blows my mind!

  • So far none, but I may soon be using a few
    as I read through the 2nd vol. of PHP Anthology.

  • Mika Tuupola

    Lots of PEAR and PEAR compliant classes, but especially DB, DB_DataContainer (not to be confused with DB_DataObject), Log (whose composite logging is simply great) Net_URL, Spreadsheet_Excel_Writer, Cache_Lite, Mail and Mail_Mime to name a few.

    Also jpgraph has been proven to be great.

  • kellan

    DB_DataObjects, Smarty, QuickForm, QuickForm_Controller, and Magpie (but hey, I wrote it)

  • MickoZ

    I am seeing Savant here mentionned for the first time.

    Nobody considered SimpleT ? ;-)

    I think using php as template language is GREAT. Then we might need to cache, etc.

  • MiiJaySung

    * Occasionally WACT’s template system
    * HTML SAX (in PHP4)
    * The odd PEAR class (Mail packages, and will be using XLS Writer)
    * Creole

  • dusoft

    you got wrong URL (misspeling / type error) in phpmailer – sourceforge….

  • Maxim Matyukhin

    pear-classes : Mail_mime, HTML_Template_Sigma, HTTP_Download, HTML_Select, HTML_Menu, HTML_TreeMenu, HTTP_Request

    Other stuff: adodb, dbtree (

    I’m not using wact, propel, prado bug got many ideas from this stuff

  • I recently switched to Savant, it simply rules :-)
    Other than that, MDB2, simpletest (I’m starting to see benefits in test-driven development), PEAR::HTML_QuickForm (I have a couple of commented examples on my website), PEAR::VarDump, PEAR::Validate, …

  • Eclipse

  • Dave Scott

    Loads of PEAR libs – highlights are DB, HTML_Quickform, Cache_Lite, phpMailer – saved me many times, Savant, Smarty

  • rushabh

    I am using PEAR::Excel Spreadsheet writer in one of my current projects. I was surprised at the ease with which one can generate excel reports with it.

  • Noboonaga

    Hands.php, Brain.php, Paper and pen.

  • Patrick


    Used to use PEAR::Cache_Lite.

  • Hi guys, (To whom it may concern)

    This may be the wrong place to put this but I’m in need of some help. I very new in this PHP thing and I am stuck in the mud because the PHP engine I downloaded is giving me problems. Each time I load my PC, it shows a pop up that says “PHP STartup Error: Dynamic Libraries not found: C:/php/ext/php_mysql.dll”. It shows about 20 times for the respective dlls in the folder. The point is the folder ‘ext’ in my PHP folder is currupt. I would be glad if someone kind could send to my email address, the c:/php/ext folder. It’s preventing me from connecting to the MySQL database on my pc. I’ve got a serious project i am to work on this month. Thanks a million.

  • Anonymous


  • Anonymous

    Bluebox39: You should ask on the forums, there is a ton of support on there. :-)

  • Paul M. Jones

    Savant [] for templating, and Yawp [] as an application foundation. (Big surprises there, as I’m the author in each case. ;-)

    Yawp is based around a few important PEAR [] libs: Auth, DB, Cache_Lite, Log, and Var_Dump. So I use those as they are part of Yawp.

  • SimpleTest, Propel, PHP5/XSLProc, all good stuff.

  • None, maybe I only coded some very simple scripts, don’t need the library yet.

  • Pear: Quick_form, HTML_Table, HTML_Upload. I also use ez_sql, AwesomeTemplateEngine, patUser, ADODB, Magpie RSS.

  • Bila Codrut

    AdoDB, Smarty, TurboPHP(, a nice PHP IDE API with great potential, still under development, but in more than 80% functional.

  • _dreamer_

    it is just a class but facilitates php coding more than u can imagine :

  • Trevor

    I’ve been happy with Phorm for emailing with MySQL data capture – but it seems phpMail is the popular favourite. Can anyone here advise on how they compare, please?

  • llarensj

    I use PEAR for almost everything.

    PEAR_DB to access MySQL.
    DB_DataObject for some complex maneuvers (but I still don’t get with DB_DataObject_FormBuilder, sigh).
    HTML_QuickForm (of course!).
    HTML_Table (I still don’t get with datagrid).
    Auth for some simple logins.
    Liveuser for the new systems.
    SpreadSheet to give .xls to Microsoft freakies.
    Archive_Zip to give .zip to winzip freakies
    XML to interchange info with a pair of outside systems.
    Log to know what a hell the users are doing.
    Validate to cut the crap the users insist to put in HTML_QuickForm.

    Err… I think I miss 1 or 2 but I don’t remember it :)

  • I use MING.

    I can’t believe no one has posted anything about it. Ming is a swf output library that gives the user the ability to create flash objects. It even lets you attach actionscript to your sprites and movies… check out some of my experiments with ming

  • sorry about that anchor… thought that would work

  • I’ve always had good results with ezSQL, and I’m suprised I don’t see it mentioned more often… Anyone have any thoughts on it?

    I use ezSQL & I just love it. Its light weight & damn easy to use, just cool. I discovered it through WordPress as earlier I was using a function of my own to get records or execute queries. But I find this is better. :)

    Also, I use HTML Mime Mail for sending out eMails, its easy, can do multiple attachments & HTML/Text eMails. One thing that it has but phpMailer lacks(I think so) is that it can send out eMails through both SMTP & PHP’s mail() function out-of-box. I use the mail() function so that when I copy the code to run on another server, I don’t need to change anything & it’ll run smoothly.

    I use a templating engine of my own as I found Smarty too heavy & not good enough for my use.

    I use GeSHi for syntax hiliting(it after all is the engine behind my iG:Syntax Hiliter plugin for WordPress).

    I think that’s all the 3rd party libs that I use. :)

  • arwab

    my org uses ones that we have built and customized over time. Our template works great (although it is a bit on the obese side of things

  • jblythe

    We use mainly PEAR classes, DB, DB_DataObject/DataObject_FormBuilder,DB_NestedSet, HTML_QuickForm, Pager, Mail_Mime for a framework we have had good success with Phrame (MVC) for templating we use PHPTAL which we find very useful. Sorry no links try Google :)

  • Paul Becker

    Harry, your link for phpmailer is broken.

  • I use magpie for XOOPS module XMLine.
    Will take a look at “RSS Writer” for RSS generation.

  • Doug Robb

    Ok for those that like savant take a look at dbForm (be careful there are a couple about) at

    It does more than make template driven forms, it actually handles the selects, updates and inserts too. Well worth investing some time taking a look! I’ve used it on and off and I still haven’t found a better solution to this sort of functionality.

  • Julian

    I use Smarty extensively on multiple sites for templates and caching. I’m definitely not moving to Savant.

    phpMailer is great, there’s none better for mail services.

    I’ve built several sites using ezSQL but I’m dissatisifed with some things – it will output some errors to the page even when you tell it not to, and it has some really broken code in the SQL Server version that I’ve mailed the author about with no reply. I’ve ported some stuff to ADODB but Creole looks interesting as well.

    I’ve used HTML_Quickform on one site and liked it.

    Also used PEAR::HTTP_Request but had problems with UTF-8 compatibility so dumped it.

  • Andrew Eddie

    ADODB, Cache_Lite, patTemplate and phpMailer as previously mentioned
    PCLZip & Tar for archive manipulation although there are a couple of security holes to fix
    phpGACL for access control
    DOMIT for XML parsing (was using Incutio but it seems development stopped in 2003) and RSS
    XP-Style Tabs

  • flyer727

    None of these, since I didn’t know any of them existed, but I’ll have to look into some of them before my head explodes.

  • biji
  • flow

    AwesomeTemplateEngine and Blueshoes (mainly for forms). Won’t use Smarty or any other of those bloated template engines that define a new language for coding.

  • Dave

    I also Use phpMailer, seems to be the best one.
    Trying to select a Template system and looking at patTemplate, although Savant looks promising too.

    ADODB for db stuff although also looking at PEAR:MDB …

    Also had fun with on the fly images using phpThumb generator .. can’t remember where I found it… sorry.

  • Anonymous

    for DB, I use the new PDO extension :D

  • Ben

    PEAR: DB, DataObjects, Auth (don’t like it much though)

    This thread is probably the most informative thing on PHP i’ve ever read. Got a lot of libraries to go learn about now…

  • MDMarkBowman

    Just started using the PEAR Packages really. Some of them are a god send especially the DB Abstraction Layer. We created our middleman classes around the libraries so if we decided to move away from PEAR anyway we could write our own stuff if a PEAR Library element was running out of steam.

    What I like about using the libraries is that you have a development team on each project. This gives me a lift as we have just started looking at Authentication and Permissions for our software development. We designed exactly what we wanted from this and found out that LiveUser does exactly the same and as there is no reason to re-invent the wheel we decided on LiveUser. Four people work on developing this tool (we don’t even have 4 developers on our own software). Although the manuals (as with most opensource stuff) for PEAR are terrible spending time working out using it is less in developing something thats already freely available.

    From a Business and Consultancy point of view using these libraries on small projects is a great idea. We used our own code on a few small websites a couple of years ago and now they need much more extensive functionality (i.e one needs LiveUser) and trying to integrate it in is proving a nightmare. Goingback over code that was done 2 years ago and not well documented is tough. The HTML Templating is so time consuming. Even though the projects were small, we didn’t think long run and thats the big mistake in development and roadmap of any software. Developing for now only gets you in trouble.

    How easy would it be if for example if LiveUser were integrated but you were only utilizing small amounts of its functionality, but then in 6 months your client has grown and need you to help with permissions. Or the DB layer needs a connection to an Oracle DB rather than just MySQL or MSSQL.

    I will not pay a developer to re-work his own work. If for his £45 -£55 per hour he could not build something forward thinking enough the first time I would not employ his so called expertise again. Obviously not everything can be built like that 100%, but I would expect a expensive developer to think forward.

    PEAR in my Business Consultancy and Web Development Management eyes is forward thinking for many of the PHP functions that you would ever want to write. Utilize them even in small projects and your future upgrade/reworking for clients will be minimal.

    Dont need to use the PEAR::Date think again and imagine you were 1 year down the line. Think about the client needs in 6 – 12 months and decide what its requirements will be. We did this with our software development of a Shopping Cart and CRM Backend Application and PEAR fits in now and will in the future (we hope). When we created the Cart it didn’t need the whole and extent of functionality that many of the PEAR Tools we integrated (i.e. we only need small pieces from PEAR::Date or the other various tools), but when we released “Our Cart Corporate Enterprise Edition” taddah, it took very little re-working to get a larger edition developed and working with bigger clients.

    We use PEAR:

    Also looking at
    Web_Services_Google for one project

  • Leech


    I use Code Igniter as framework (and basic templating sometimes) from the creators of the ExpressionEngine and pMachine.

    And the fantastic Tiny But Strong templating system. Just one file and tons of possibilites, specially for work with designers.

    Also I use:

  • carter

    Very Very nice information here… Thanks

  • JOKERz

    Yeah…….. lot of great info here……


    I use PatTemplate and Smarty for my presentation. I feel more biased towards Smarty,since its more flexible and smart enough to include most, if not all, of the presentation logic.

    Just getting around to using PDO for my current project.

  • first time i ran through your site.

    really like your site.

  • bmickler

    Smarty for templating ( (Smarty rocks.)

    PEAR::DB for database abstraction. Yeah, it’s like killing a mosquito with a bazooka, but it’s easy to implement. (

    PEAR::IMAGE for doing amazing dynamic graphs, very cool once you get it going!

    DB_DataContainer for object persistence, although the project and website could use a lot more documentation. I am having trouble figuring a few things out, like sequencing ID’s. If anyone knows of another object persistance class that easy to implment, uses PEAR::DB, and doesn’t require a bunch of xml configuration, PLEASE post a link! (

    BTW, cool site.

  • Ravi Kumar

    How about They run smooth with PHP.

  • PsyKi

    So far, I’ve only used the PEAR libraries….

    a few of those xml (serializer, util)

    I like those.

    This thread really got me to look up some things.

    thanks guys/girls.

  • ifnu

    whoa… this thread is great,

    i’m java programer who accidently have to jump to PHP. I’m used to use some java framework and i see that sitemesh have it’s php version. But i still looking for display tag’s php version.

    but i see that PEAR used widely here, also savant :D

    did anyone tried zend framework? it’s look promising :D

    i’ll take a try :D

    thanks all

Get the latest in Front-end, once a week, for free.