What keeps PHP out of the enterprise space?

October 24th, 2004

php_med_trans.pngI love PHP. I guess that’s probably because my programming roots are in C/C++. However, you’d think that I would love Java equally then. The fact is, I don’t. Java just seems so restrictive to me (I know, some of you are going to say that’s a good thing, which I won’t totally disagree with). I love PHP because it is wonderfully flexible. It also has a wonderful toolset to go along with it. Things like the Smarty template engine and the PEAR extension repository. This flexibility and toolset makes rapid development in PHP extremely easy. Why is it then that PHP hasn’t penetrated the enterprise web application space? Here are a couple of reasons (and maybe a couple of enhancements to consider, PHP devs):

  1. No database connection pooling - One of the factors that causes most enterprise web apps to ignore PHP is that there is no built in database connection pooling. Database connection pooling addresses the fact that database connections are expensive in a program. If your web servers have to make a new connection for every request, that’s alot of TCP overhead. The concept of a connection pool allows the web server to make just a few connections to the database server and keep them open, routing all requests through that pool of connections. This greatly reduces the TCP overhead for database request and helps your application scale much better. The fact that J2EE has connection pooling built in is one of the reasons that it often gets the nod for enterprise web applications. Of course, there are third party database pooling layers like SQL Relay, but that means you’ve got to add another layer to your applications, which of course has impact on the cost of supporting that application. Plus, I bet a native database pool could perform better still.
  2. Just too flexible - Let’s face it, PHP can be just too easy to do something stupid in. Now this can be prevented by a disciplined development methodology and good developers, but what project actually has extra money for that? Of course this flexibility is one of the things that I love about PHP, but it is something that makes it better suited for a small project with a handful of disciplined developers rather than a large project with a few disciplined developers and hundereds of mindless code monkeys (that’s what all the enterprise application development projects I’ve seen look like anyway). Sure PHP 5’s more comprehensive object oriented features help to address this by giving developers ways to protect their objects better, but it still lacks some very important features - like multiple inheritance.
  3. Lack of professional developers - As popular as PHP is, its user base is mostly amateurs. This is kind of a catch 22. How are you going to develop professional PHP developers if no one wants to do enterprise applications in PHP? If PHP is going to penetrate the enterprise space it is going to have to develop a community of professional developers. Now, don’t get me wrong, I know professional PHP developers exist. It’s just that there aren’t many of them. Or maybe the experienced developers steer clear of PHP because of point 2 - because it doesn’t slap you on the wrist when you try to do something stupid. If that is the case, maybe it is time that developers start putting the appropriate controls in their application design methodologies rather than depending on a language to watch out for them. I know it takes more work and more discipline, but it’s probably worth it. Besides, that discipline is going to cascade into all levels of the application - the database design, the SQL, the application architecture. Seems to me that the application has a lot to gain from an approach that depends so heavily on developer discipline. The argument against this is of course that you have to trust the people working on your project, and that means good people, which is expensive (but do you want your project to be a success or not?).

These are some of the reasons that my employer has not chosen PHP as a viable language for enterprise applications. Costs of deployment (initial investment is $0 - PHP is free) and support are low. Programmer productivity can be increased because of the huge open-source community developing plug-ins, extensions, and libraries for PHP. Performance is good (at least with accelerators like ionCube and Zend). Even so, PHP seems to have been relegated to small websites and the occassional neat little obscure web application. I know how powerful and extensible it is - that’s what makes me think that it has a space in the enterprise market, if only a few shortcomings can be addressed.

Or maybe I’m off my rocker. Maybe somebody can prove me wrong. Anybody know of enterprise applications that run on PHP or are currently being developed on PHP? I don’t know of many good examples. There’s Friendster - who tried to hide their transition to PHP, and then fired a PHP developer working for them for talking about their transition away from J2EE to PHP. Anybody know of any projects that are proudly and successfully using PHP (at an enterprise level)?

4 Responses to “What keeps PHP out of the enterprise space?”

  1. Timothy A. DeWees Says:

    Well,

    My company developes entirely in PHP and we are a 750 person company. We now have around 12 programmers on staff and we seem to get it done. We do have a very strict coding standards, class layout standard, and of course, a code rollout standard the makes it virtually idiot prood.

    I have spend the last 6 months dealing with PHP’s shortcommings (most of which are not necessarily related to PHP, but more how PHP integrates with Apache). PHP5 was a true blessing; however, just switching a 10k file codebase to an entirely new version of the language is not east (yes I know about the PHP4 support in PHP5 but it’s not 100% there since some of our pages are still php3 syntax).

    All in all, I think PHP isn’t in the enterprise for exactly the same reasons you stated. I know we have been very successful with it, but at the cost of time and much dicipline.

  2. marcus Says:

    I think it’s getting there. I’ve put some, but not too much, thought into all of this. PHP is a rather powerful, flexible tool in the hands of disciplined developers with experience of what are good practices and methodologies.

    I’m near Cleveland, Ohio, and we do a lot of contract jobs to fund my company and our in-house projects. Just a few years ago, nobody wanted PHP. And while the demand is still not huge, I try to keep in touch with several recruiters who occasionally manage to find us the one or other PHP based project. Most of our projects come in from past clientele, however. Either way, I’m proud to say that with the exception of one small week-long (ASP) project, I’ve been working with PHP exclusively for the past three years. In a way, it’s a good niche market to be in.

    The lack of professional developers is downright annoying, though. I don’t use much more than the PHP.net documentation. PHPBuilder is attracting the casual semi-computer-savvy dabbler at best, with the occasional half-juicy article about things such as Web Services integration in PHP. PHPProfessionals.com is doing little more than promoting their books. Even at the risk of sounding like an elitist — when it comes to a tightly knit community of professional or just skilled hobbyist PHP developers, I have yet to find one.

  3. Deepak Gaur Says:

    I am working on PHP for the past 3.5 yrs. I agree about the lack professional developers but feel that PHP is really powerful. As far as Enterprise Solutions not being developed in PHP is concerned, companies now seem to be looking at PHP as a viable alternative. We are currently working on a couple of ERP solutions.

    Also PHP5 is as good as .NET (as far as web feild is concerned ) if not better.

  4. Tony Says:

    One of the reason that PHP is not used in enterprise enviroment is that becasue it’s FREE. As you should know, Enterprise means rich and big companies. Money is usually not the main concern for them. As PHP is an open source project, if it happens there are bugs inside their library code which causes huge lost for the enterprise, who can you blame? How do you recover the lost from a community organisation?

Leave a Reply