Become a fan of Slashdot on Facebook


Forgot your password?
PHP Programming

PHP Usage in the Enterprise 325

acostin writes "Some open survey results were published about PHP usage in the enterprise on the InterAKT site. An alternative survey on the PHP open source mouvement can be found on Zend site. See how we've evaluated the PHP market size($$$), what people think about PHP as an alternative to Java and .NET, and what should be done in order to have your large clients adopt open source solutions."
This discussion has been archived. No new comments can be posted.

PHP Usage in the Enterprise

Comments Filter:
  • heh (Score:1, Insightful)

    by Erick the Red ( 684990 ) on Saturday September 20, 2003 @01:52AM (#7010500)
    See how we've evaluated...what people think about PHP as an alternative to Java and .NET

    I don't know about java, but I can see anything as being a good alternative to .NET.
  • by Henry V .009 ( 518000 ) on Saturday September 20, 2003 @01:55AM (#7010509) Journal
    PHP is a great tool, especially if you just plan to throw something together in no time flat. Start up MySQL with PHP and Apache and you have a rather full-featured system at an affordable price: $0. On the other hand, I have no idea on reliability figures for that mixture. Still, PHP is great to work with. Easiest interface in the world.

    (P.S. Lots of programmers in the Enterprise. Data and me were always slapping together code for that clunky thing. Cloaked Romulans? Yeah right--just software bugs in the sensory system. "Uh, Captain, they've gone cloaked again." "Damn! Those ships have that capability!?!" Works every time.)
  • by Eponymous Cowboy ( 706996 ) on Saturday September 20, 2003 @01:56AM (#7010512)
    For both the Zend and InterAKT surveys, there are lots of raw numbers presented, but the interpretation is lacking. The commentaries on the InterAKT results are little more than "as you can see, such-and-such wedge of the pie is the largest," and there is no interpretation whatsoever on the Zend site.

    Of course, this is a cheap and easy way to conduct a survey (multiple-choice), but the results are almost meaningless if they can't be put into context. I would have preferred to have seen a hundred randomly-selected PHP developers interviewed, essay-style, about why they are using PHP, their thoughts on PHP versus other technologies, etc., and then have the results compiled into a journal-quality article supported by graphs and raw numbers. The important information isn't in those graphs; it cannot be enumerated and broken down into clean categories.

    Personally, I develop PHP sites because it's the fastest and simplest way I've found yet to publish dynamic web content. I've tried making sites with Java and .NET, and found both of them to be too far disconnected from the HTML that I'm trying to create. PHP provides an excellent blend of power, speed, simplicity, and directness.
  • huh? (Score:5, Insightful)

    by samantha ( 68231 ) * on Saturday September 20, 2003 @02:04AM (#7010535) Homepage
    What do we think about PHP as compared to Java and .net? What do we think about an grape as compared to a basketball and an egg? These are 3 quite different things. A HTML-generation targeted scripting language compared to a compiled general purpose language as compared to a distributed object and language framework is a pretty disparate set of things to compare.
  • PHP is ok but... (Score:5, Insightful)

    by theolein ( 316044 ) on Saturday September 20, 2003 @02:10AM (#7010541) Journal
    The language as it has been in most of it's 4.x.x iteration has been just about fine. Good for quick slap em together websites and small applications. But...

    I have seen huge cumbersome application servers built around PHP that are a nightmare to maintain without having intimate familiarity with the code of the application server, such as Ampoliros or Ariadne, something which defeats the purpose of using such a large system in the first place. Such things really do work better with a OO by design language such as Java or ASP.Net (I assume, don't know .Net) where you can rely on the functionality of the objects without having to second guess the original developers.

    My guess is that PHP needs a better OO design (and no, PHP5 is not it, yet) and better seperation of logic and presentation for larger systems.

    But for smaller stuff, well it's hard to beat in terms of price and speed.
  • by hamster foo ( 697718 ) on Saturday September 20, 2003 @02:10AM (#7010547)
    Regarding the migration. Does it actually provide any benefits? I'm not talking arguments like it being open source or cross platform etc. Does it provide REAL benefits for your situation? If it does, then that's the first step to selling to your boss. If you can justify it to yourself, then most of the reasons should translate into a pretty good reason for him to agree.

    If it saves you time that translates into money saved for him, as well as, more time for his work force to focus on other issues. If it's better suited for your applications, then it should be easy to show that to him in some form of improvement that he can see and that he would appreciate.

    You've gotta think if you walk in and show him how PHP will save him X dollars and allow Y increase in productivity then he's going to pay attention to that. If it won't increase these, then from a business standpoint, there's not a lot of reason for him to change.
  • Re:Hack-away (Score:5, Insightful)

    by jacksonyee ( 590218 ) on Saturday September 20, 2003 @02:11AM (#7010548) Homepage

    I know that you're somewhat joking, but I would have liked the market share questions from InterAKT to have included not just .NET, J2EE, or ColdFusion, but have also included other languages like Perl and Python (although Python is indeed the base language for Zope). There are still a very large amount of websites built in Perl these days, with Slashdot being one of the most famous. Zend's survey does a bit more to explore the languages that programmers "are familiar with," but does little to see how the competition for PHP is doing.

    PHP's great to use for me because it's simple, powerful, and readily available in cheap hosting environments. If Zope, ColdFusion, or J2EE had more availability or less cost, then I would try those as well, but there's something to be said for being able to sign up for a $9/month account and downloading Apache, PHP, and MySQL all without paying for anything other than bandwidth costs. You still can't really compare PHP to the enterprise level of .NET or JSP at this point though, since many features like persistent objects in shared memory really can't be done well in PHP, and I haven't heard anything else about PHP 5 other than further enhancements to the objects and reference systems. PHP-Accelerator gives a great boost to the speed, but I'd really like to see native compilation built into the distribution rather than downloaded separatedly.

    All in all though, PHP's a great language for quick development of small to medium sized websites. As the old caveat reads though, use the right tool for the job.

  • by mackstann ( 586043 ) on Saturday September 20, 2003 @02:17AM (#7010558) Homepage

    To write clean, well structured PHP, you really need to do some good design, use OOP, seperate content/formatting/logic/etc, and basically at that point, you're left with a half-ass OOP implementation, annoying pass by value, messy syntax, no exception handling, etc.

    PHP was meant for making relatively minor webpage hacks, and it shows. This still remains PHP's strong point; building enterprise applications (that are designed well) does NOT.

    Here's my list of bitches about PHP:

    * No class attributes, only instance attributes

    * No namespaces (and they were dropped from PHP 5). include()/require()'ing a file just dumps its namespace into the big happy global namespace, and it's a freaking nightmare.

    * OOP sucks. You have to litter &'s everywhere to get references, and lots of other problems that I'll refrain from typing out. Ok here's one -- how do you pass an instance method for use as a callback? Something like array($object, "method_name_in_a_string"). Good god.

    * No exception handling. Want to "handle" an error? Toss a @ in front of it, then you'll never see it. How helpful.

    * Type handling is a nightmare, sure, they make it real easy for the newbies to use numbers-in-strings as numbers, but when you're not a newbie, you begin to run into issues where it's expecting you to be stupid and as a result ends up being stupid itself, and causing you to write disgusting checks just to make sure things are sane.

    And that's the root of the whole issue, I think. Things that bend over backwards to cater to newbies end up doing a shitty job for people who have a clue.

    Also, if anyone knows of any projects (with source available) written in PHP that are designed well, I would be interested to hear of them. I looked at a tiny bit of PHPMyAdmin's code just for kicks and was horrified. But that's not a valid judgement by any means. Again, I'm just interested to see if there are any out there (and have a look at them).

    And a last thing, I might be biased by knowing Python (but I knew PHP first!). Python tends to flow very naturally for me, and even big complex things just end up being big and complex, instead of big and complex and A COMPLETE FREAKING NIGHTMARE like big things in PHP tend to wind up (for me).

    Go Python! Death to PHP!
  • by Black Art ( 3335 ) on Saturday September 20, 2003 @02:21AM (#7010564)
    Cold Fusion is also a web scripting language, but costs quite a bit.

    The last time I compared the two (admitedly a while ago) PHP had many more features and was the much better choice. (Even if they were priced the same, which they are not.)

    Even more telling is the amount of books available for each. There are seven Cold Fusion books still in print according to Amazon. (Most the same book for different versions of Cold Fusion.) A search for PHP gets 112 hits. (I am not certain how many are still in print. Much more than seven.)

    Comparing Java (a general purpose language) to PHP (a web scripting language) seems to be a bad comparison. Comparing it to .net (a proprietary collection of patent encumbered programs and methods) even more so.
  • by segment ( 695309 ) <sil@ p o l i t r> on Saturday September 20, 2003 @02:50AM (#7010625) Homepage Journal

    The PHBs here view php as something "geeky" that isn't suited for business. I'm sure they'd lap it up in a second if it were called MS Visual php Studio, however.

    One thing you should keep in mind about programs from MS is that although they are crap, they offer someone you can speak to on the phone 24/7 as opposed to us geeks chopping things up or finding a forum, or jumping on irc to fix things up or create something. Microsoft is pretty and CTO's, CEO's, CFP's etc., need to be able to understand a product somewhat. I've used PHP for some time, and from my perspective is, there are too many hands in the pot spoiling the food.

    Seems like every other month some new and improved programming language comes along and becomes the standard or some future standard. From a business point of view, I would rather go with what is established as opposed to what is promising. Promising isn't going to speak to a CTO through some task should his IT department walk out. Aside from that, standards already around are accompanied by people who get certified to perform these tasks. Now we know not all certs mean squat, but it's easier to find people who follow standards than those who follow promise.

  • by b17bmbr ( 608864 ) on Saturday September 20, 2003 @03:02AM (#7010652)
    i used perl almost exclusively, then had a couple of projects and used php. it was a dream to use. nice syntax, powerful built in functions, not super verbose like java nor bizarre like perl. you can cruft together a few pages or create a huge site. been there, done both. however, remember PHP is a templating language. designed to be so. so, it is not necesarily an OOP language, yet is is OO in nature. for instance, create different .php files and piece together your pages. as for security, use good programming skills. duh. for instance, keep your connections in separate files. then just include("connection.php"); that will help.

    that being established, it will have trouble being accepted as an enterprise tool because it is not backed by a company. java backed by sun, .NET by what's that company, i forgot. linux didn't really enter mainstream until IBM ponied up a billion. no matter how great a tool, it just seems cheap, and to businesses, they just won't "risk" it. sad. the other problem that php has it that it is esy to put together a good site, and easy to learn and use. java and .net are not. so, it seems like BASIC. you can't use that for serious apps.
  • by Skim123 ( 3322 ) <mitchell AT 4guysfromrolla DOT com> on Saturday September 20, 2003 @03:08AM (#7010665) Homepage
    A more appropriate question, as another poster mentioned, is what's better: PHP, classic ASP, or Cold Fusion? Those are stand-alone scripting technologies. ASP.NET and JSP are more platform-based, providing true OOP, an impressive set of base classes, and so on.

    If you are interested in the scripting language comparison, see Server-Side Scripting Shootout [].

  • by mackstann ( 586043 ) on Saturday September 20, 2003 @03:12AM (#7010670) Homepage
    The problem is that people *do* use it for these heavy duty tasks. "PHP Usage in the Enterprise"...

    It's like a lot of things: not bad, but grossly misused. Flash is not a bad technology. PDFs are not a bad technology. Javascript is not a bad technology. The problem is that people use them for all kinds of stuff that they shouldn't, and it winds up working like crap and annoying people.
  • by Cyberax ( 705495 ) on Saturday September 20, 2003 @03:52AM (#7010744)
    .NET has COM+ for backend systems, Java has EJB, but PHP has nothing :( I can't use distributed transactions, transparent failover, declarative security and transaction demarcation in PHP.
  • by forevermore ( 582201 ) on Saturday September 20, 2003 @04:29AM (#7010800) Homepage
    * No exception handling. Want to "handle" an error? Toss a @ in front of it, then you'll never see it. How helpful.

    Then what's the set_error_handler() [] function for?

    I have to agree about the OOP, though. I wrote a pretty large-scale ecommerce project in php, though, and it took me about 1/5 the time it would have taken in perl.

  • by jorleif ( 447241 ) on Saturday September 20, 2003 @04:44AM (#7010843)
    You would probably use an accelerator on real projects anyway so the compile point doesn't count really.

    I've used PHP without an accelerator in all "real projects" and never had any performance problems on the PHP-side. For web-applications the bottleneck is mostly the database so most "PHP is slow" vs "Java is slow" arguments are fairly pointless. The real issues are more often development speed and robustness. Of course if you're going to implement some nifty algorithms Java might be a better choice, but why not write those in any language and make it a PHP-extension or some kind of server?
  • by jadavis ( 473492 ) on Saturday September 20, 2003 @05:00AM (#7010878)
    Exceptions are required for enterprise quality applications.

    I don't think that they're required, look at perl & C.

    PHP definitely has some issues.

    * By the time you're done coding it right, it's as long as similar C code
    * Exceptions are a very nice way to handle things properly and concisely, and die() is certainly not a solution.
    * Not easy to contrain variables to a type (type contraints are essential for any good database, why not for a language?), i.e. you can't cast a variable without doing something ugly like settype($x,"integer"), which modifies the argument.
    * Not good class/object support, no namespaces
    * Include()/require() are weak

    Let's face it: PHP's strength is not the language, it's not the library, it's the platform!

    PHP makes a nice template language that helps you organize simple web apps in a simple way, quickly. It's nice for a sysadmin of a virtualhost (it allows safe mode operation and enforces it's own limits on RAM & CPU). PHP knows what it takes to write a web app, and it puts everything right in front of you, and that's what's good about it, the platform.

    So, I say scrap the language! Just steal perl or python or ruby or any combination of the above! Use their syntax, their libraries, their speed, their developers, their object models, everything. Why did they need a new language? Who in there right mind thinks that PHP is on the cutting edge of syntax, or consistency, or standard libraries, or OOP, or anything like that? Embed some other language into the platform.

    Think if all of the PHP developers time was spent coding something like mod_python|perl|ruby. Maybe they could even allow any language per coding page or something cool like that.

  • by harry_f ( 709241 ) on Saturday September 20, 2003 @06:02AM (#7010981)
    There are 75.000 PHP development companies in the world, totalling 150.000 professional developers. Each company creates 12 websites per year on average, and one website takes approximately 32 work days to be completed.

    The average price of a PHP dynamic website is USD 6.000, and a regular company receives USD 75.000 income from PHP development per year. By multiplying this with the number of companies in the world, we can estimate the size of the PHP software development market - USD 5.6 billions.

    Potentially that's a massive market to anyone selling PHP related tools (and their aren't many). Of course that's based on the questionee's estimate.

    Zend is throwing the number "500,000" PHP developers around. That might be accurate - Interakts survey made the assumption that you worked for a PHP development company and had clients. That ignores, for example, those building intranets for internal use only, which my, guess is a significant number.
  • by Qbertino ( 265505 ) <> on Saturday September 20, 2003 @08:03AM (#7011212)
    I've done quite some web developement with lot's of stuff, including JSP, Zope/Python and PHP. I'Ve looked into CF and ASP.Crap and have heard all the MS Junkies doing verbal wee-wee in their pants over how so very sweet their new stuff is.
    After all these years I've had my perception of things confirmed day in and day out:
    The best existing webapp technology ever concieved to this very day is the Zope Application Server together with it's intergrated Object-Relational Database, it's PL Python and the SSI solution TAL (Template Attribute Language). It will take _everything__else_ in the industry something like 5 years at least to catch up.
    Apart from that, anything that strives to go the pure SSI approach with a separated DB eiher uses PHP or most certainly is crap. It's really that simple. I've evaluated CF (Nice dynamic flash with a poor mans PHP for 10000$. No thanks.) and ASP, finally moving into usable regions with .Net but still stomped to chunky kibbles by PHP and it's community. Both won't even come close.
    JSP is a nice substitute if you've got a Java Enviroment there allready. But then again, who would want one if you get allmost everthing (apart from maybe banking applications) ready or done faster in PHP.
    Bottom Line: If you've got a standalone Server for your project, use Zope and all the goodies that come with it. On the other hand, if Apache is a must, mod_php is present and/or you need a finished OSS solution *now* you use PHP. PHP has the largest dev-community, and for good reasons too.
    I really can't take CF or .Net zealots serious anymore.
  • by the-matt-mobile ( 621817 ) on Saturday September 20, 2003 @09:48AM (#7011504)
    You can't compare PHP and ASP.Net.

    I don't see why not. They are both technologies designed to provide dynamic content via the web. Just because they require different methodologies, doesn't mean they are incomparable.

    PHP is not a true object-oriented programming environment.

    Where I work, we favor Microsoft technologies. I use ASP.NET and I love using it. But the object-oriented stuff gets in my way more than it helps me. OO is not the best paradigm for web development. HTTP is a stateless protocol (albiet there are layers on top of it like cookies which allow for maintianing state) so creating a whole object structure on the server to manage data is a waste of time because the objects are lost after the request completes anyway and have to be recreated on each subsequent HTTP request. And trying to build presentation using objects is a nightmare. (An HTML table as an object? Please!) No, the OO paradigm is not what makes ASP.NET better to use IMO than ColdFusion, classic ASP, and PHP (I've used them all on other projects at other companies). The part where ASP.NET shines is the separation of presentation from code. In a properly coded ASP.NET page, almost no server side code is present in the aspx page, and all of the work is done in a "code behind" area. That is what I find lacking when using PHP - not an overrated OO-for-the-web paradigm (OO is great for other things though), but in a proper MVC architecture with separation of code and presentation.

    On top of that, the PHP language is not strongly typed, and you don't even need to declare variables

    Truthfully, I see that as an advantage of PHP over ASP.NET. Yes, traditionally weakly typed languages perform slower than strongly typed ones, but other than that the advantage of not having to deal with excessive casting is a fantastic advantage. You may argue that it allows for bad coding practices, but I'd counter with "what language doesn't?". If you want to be stupid about it, any language will let you do things wrong. Languages like Java try so hard to force you to do things right, it ends up being at the expense of useful functionality. No thanks.

    PHP has no structured exception handling

    Yeah, I agree. That does suck.

    When performing operations like variable assignment and passing the object as a parameter to a function, the whole object is copied

    I think that depends on your point of view. Not having the option sucks though.

    On the other hand, ASP.Net is a true OO language, with inheritance, polymorphism (overloading of methods) and encapsulation. ASP.Net is strongly typed. ASP.Net is compiled and JIT'd.

    I don't mean to sound snotty, but my honest reaction here is "so what?". OO is a great paradigm for other things, but it falls short when trying to use it for web development. And, being compiled arguably makes ASP.NET harder to debug. I'm no fan of VB, but at least the VB environment allowed dynamic changing of code during a debug session without having to stop the debugger, recompile the code, and start again. Interpreted languages are not nearly as slow anymore as everyone claims them to be, and in the real world it seems that rapid application development will win out 9 times out of 10 over rapid program execution. A lot of bad architecture decisions are made in a falsely percieved need to boost speed all the time (just ask the Java camp about the state of affairs in the late 90's).
  • by TomV ( 138637 ) on Saturday September 20, 2003 @09:58AM (#7011545)
    I can't begin to express just how useful, every day, I find the discipline I learned from my first boss in a proper computing job.

    Bill was an old-school, where's-my-schema, lets-see-the-docs-first, mainframe guy. And every time anyone would suggest any change to the systems we were building, Bill would ask:
    "What's the business case for that?"
    Superb. Must have heard that several times a day every day until I internalised it. We all get great ideas for our systems, perfectly technically valid inspirations. But where's the business case?

    If fast and easy is all that's needed, what's the business case for using J2EE? If complex transactionalised distributed business logic is what's needed, what's the business case for using PHP?

  • by __aawpnr5477 ( 589902 ) on Saturday September 20, 2003 @10:22AM (#7011630)
    I used PHP extensively for a number of years and finally wrote my own framework. In the end it turned out to be very much like some of the Java frameworks out there.

    IMHO the good parts about PHP are also the bad parts. ie, * you don't have to say what type a variable is, but that means you can't specify a type of parameter to a function. * you don't have to specify scope, but then you can't protect functions that should be private etc.

    I looked at a lot of Java code for ideas on what I could do with PHP to clean it up . The main things that I did were: set up a 3 or 4 tier architecture.

    • database abstraction layer
    • business layer
    • presentation layer (preferably using templates)
    (I modeled a lot of this on Enhydra -

    never use globals. Wrap up the HTTP_GET_VARS, HTTP_POST_VARS etc in a class (ie Request). Create classes to wrap the server vars and whatever else.

    Use classes for everything. This gives you a reasonable amount of namespace control.

    Never access variables directly in classes. Create accessor methods for them.

    I think that if you are feeling the need to structure your PHP, you will probably need to move towards Java or some other more structured language. It can definitely be more challenging to write, but as your applications get bigger, the compiler-enforced type checking, programatticaly enforced/supported interfaces etc will save you a lot of time in the long run.

  • by WoTG ( 610710 ) on Saturday September 20, 2003 @01:42PM (#7012612) Homepage Journal
    I've used PHP quite a lot lately. And it's great. On the whole it is every bit as good as the last versions of ColdFusion and ASP that I've used (admittedly those are a version or two old by now).

    To me, the biggest strength of PHP going forward is the huge number of people that are improving the PHP experience every day.

    1) New features? There are free extensions and modules for templating, database abstraction, compiled script caching, and more.
    2) Sample code. I'll bet that there are more free as in speech snippets and full applications of code available for PHP that any other web language.
    2) Community. There are lots of sites and other online resources where PHP developers can find help with debugging code when they need it.

    Once you toss in great cross-platform support - PHP runs on just about any web server of interest - and a good price ($0), PHP is very competitive.

    No, I wouldn't want a bank running on PHP, but for MANY other uses inside companies, PHP is good and getting better. I liken it somewhat to Linux a couple years ago with respect to corporate acceptance. The foundation is more or less built, what's left is some time to mature and gain credibility.

The primary function of the design engineer is to make things difficult for the fabricator and impossible for the serviceman.