Slashdot Mirror


Introduction to PHP5

Yet Another OO Fanatic writes "PHP core developer Sterling Hughes has a excellent presentation (mirror) about PHP5 online. So far it seems to be the best coverage of the new features in PHP5; highlights include the new object model, namespaces, interfaces, access control and exceptions. Java by any other name..."

338 comments

  1. yikes! by Telastyn · · Score: 2, Troll

    0 posts, and already slashdotted? the subscribers must've gotten to that one early!

    And what's with the java comment, PHP is pretty much nothing like java. It has different uses, different strengths, and different semmantics. When are they going to properly fix PHP like making it stable? (*gasp*)

    1. Re:yikes! by Anonvmous+Coward · · Score: 0, Offtopic

      "0 posts, and already slashdotted?"

      One post and the moderators already get to use their redundant modreration?

    2. Re:yikes! by Anonymous Coward · · Score: 0

      Here is a quick fix to make PHP stable:

      pkg_delete php
      pkg_add mod_perl

    3. Re:yikes! by b0r1s · · Score: 0, Flamebait

      And what's with the java comment, PHP is pretty much nothing like java. It has different uses, different strengths, and different semmantics. When are they going to properly fix PHP like making it stable? (*gasp*)

      The problem with PHP isn't stability, it's a bogus security model that makes is unusable on massively multi-user systems.

      --
      Mooniacs for iOS and Android
    4. Re:yikes! by Anonymous Coward · · Score: 1, Funny

      it's a bogus security model that makes is unusable on massively multi-user systems.

      In other words, stability.

    5. Re:yikes! by dirvish · · Score: 1

      And what's with the java comment, PHP is pretty much nothing like java.

      Yeah, what's with the flaming in an article? If that were a comment it would be modded down as a flame. Why add that line to a PHP article?

    6. Re:yikes! by joab_son_of_zeruiah · · Score: 5, Insightful
      And what's with the java comment, PHP is pretty much nothing like java. ...
      I understood the sense of this remark to be more about the PHP's and Java's capabilities to access other software systems, rather than a comment strictly about the language. Check out the PHP reference manual. Sure, the language is the first few chapters. Then check out the other *100* chapters.

      One of the things I find fascinating when I compare the two at a system capability level is that they are equally capable. It's just that PHP is so much more easy to use, whereas Java is so much more orthodox. Easy to use often wins over orthodox.

      In the long run PHP has as much chance to be a Java killer as .NET does. In the great battle for free vs. proprietary software do I really need orthodox?

    7. Re:yikes! by Anonymous Coward · · Score: 0

      0 posts, and already slashdotted? the subscribers must've gotten to that one early!

      u ever think that maybe people read the article and dont post on slashdot? that would explain why its slashdotted when there are no posts yet.

    8. Re:yikes! by Anonymous Coward · · Score: 0

      No, that never happens. Seriously! Everyone posts without reading the article. Every... single... time. Without fail. Always. Some other explaination is at fault. Could it be that the announcement was made before /. posted the story? Maybe...

    9. Re:yikes! by sporty · · Score: 0
      One of the things I find fascinating when I compare the two at a system capability level is that they are equally capable. It's just that PHP is so much more easy to use, whereas Java is so much more orthodox. Easy to use often wins over orthodox.


      Java isn't much harder than perl or php. Wanna print something? Java is 3 lines of code, while php is at shortest, 1. Print more? It's not THAT much more code to either language. The complexities of each language aren't far off. One just has superior OO while the others are more .. "loose".


      In the long run PHP has as much chance to be a Java killer as .NET does. In the great battle for free vs. proprietary software do I really need orthodox?


      I doubt it. Java has one thing php doesn't and java is far ahead on the curve. Application development. DOn't give me that php-gtk thing either. Java does OO right, right now. Granted, swing is a little slow, but SWT takes care of that now. php doesn't do a lot of the things java can, nicely. i.e. Distribution and jar's for instance. Event handling for another.

      I'm gonna get marked as flaimbait for this one, while php is neat and all.. it's not enterprise ready. At least with java, I can get all my modules to work nicely /w each other. Last year, DOM had a problem working along side the ssl modules. ALso had a code base size causing php to randomly crash. Yes, its OSS, but I rather not worry about what java delivers now, good, solid, core libs.

      --

      -
      ping -f 255.255.255.255 # if only

    10. Re:yikes! by kipsate · · Score: 2, Insightful

      In the long run PHP has as much chance to be a Java killer as .NET does.

      I don't think so. As one of the first posters with +5 comment score points out, you will run into the wall when doing big projects with a scripting language. And despite all the nice OO-like features that have been thrown in to PHP, it still is essentially a script language.

      I have been working on a project where we built a not-too-complex site using Cold Fusion. It started out simple: read in form fields, throw them in the database, read them and present them as a web-page. Cold Fusion or PHP are great for this.

      Not much later, the application became more complex. We got more tables, and backoffice people needed to be able to do fairly complex mutations. We ran into the wall with CF. We hired professionals that spent about EUR 500,000 to try to write our back-office system in CF. They never delivered anything (also due to the fact that they were not the most professional company - if they were, they wouldn't have started off using CF).

      Now why is it that scripting languages blow up when projects get bigger? You'd say that all you do is showing forms and pumping around data in the database.

      We moved over to dotNet (there goes my Karma). Suddenly things became a lot easier. Why? Because we were able to program object oriented, for one thing. (So - java would have been similar order of magnitude improvement over scripting. You may mod me up now. :-)

      We were now able to cleanly seperate our code in distinct building blocks, without any overlap. Each class (an OO-building block) had a very clear job. Changes on a class that for instance handled sessions, did not cause other parts of the code needing adaptions. There were just a few isolated classes doing database transactions. Logging, error trapping and user tracking were much easier - we didn't need to pollute many files in our code with LOG messages - we could centralize them using exceptions.

      Now some of you may say: "PHP also has this". But PHP is not a pure OO language.

      To all who are not convinced that OO-programming is adding any benefit: Get a copy of Bertrand Meyers hallmark book Object Oriented Software Construction right now. It will explain what OO really is about and explains quite scientifically why procedural programming is inferior when programming larger projects that do not need to squeeze the most out of every clockcycle (for instance, backoffice projects, web sites). The book is over 1300 pages, but you can be sure that you will not want to program non-OO anymore before you have even reached page 100. Then it will also become clear PHP is lacking many OO features.

      In short, there are many criteria before a language can call itself fully OO (the book mentions 15!). The main benefits OO brings you are reusability of code, and being forced to use a certain structure in your code. PHP does not qualify as OO, despite the OO-like features that were thrown in.

      To finish the story: our CF scripts were quickly replaced by C# (the .net language of choice - a somewhat improved java).

      There is one other consideration though, that I must mention. Not unimportant: economic considerations. OO-programmers are more expensive and harder to find than procedural programmers. This may lead companies to decide to go for non-OO techniques. But they shoot themselves in the foot as soon as they want to build even a moderately complex back-office.

      You can also turn this around: learn OO, be more productive, and have a higher salary as a bonus.

      --
      My karma ran over your dogma
    11. Re:yikes! by Electrum · · Score: 1

      The problem with PHP isn't stability, it's a bogus security model that makes is unusable on massively multi-user systems.

      That is an Apache shortcoming, not PHP. Any other programming language will have the exact same problem, unless the entire program runs in a secure virtual machine.

    12. Re:yikes! by Narcissus · · Score: 1

      I don't know if this really counts, but where we work the really complex work is done in PHP extensions. It actually started as a way to slowly move everyone across from all of their little apps that were floating about. ie. extracting code to a DLL (that was recompilable to a PHP extension) and changing the original app to use the library while we wrote the new PHP based one.

      That way, we got the OO positives of C++ (internal to the DLL: the library itself had to have a C interface for PHP, so we wrote C wrappers for the "real" C++ code) plus the ability to dump those libraries into Windows applications if that were absolutely necessary (eg. offsite).

      So now our PHP code basically does display and user interaction, while all of the complex business code is done in C++ libraries.

    13. Re:yikes! by iamdrscience · · Score: 2, Informative
      Now why is it that scripting languages blow up when projects get bigger?
      It's not like this is a feature inherant to scripting languages, Python has very good OO implementation and capabilities and would very easily expand for larger projects. The same is not true of PHP or Perl with their somewhat half-hearted attempts at OO.

      Don't get me wrong though you PHP and Perl fans, both of those languages are still great at a lot of things and I'm not trying to slam PHP or Perl. I love PHP, it's a very very fun and useful language, I use it a lot, but there are some things it can't do and some things that Perl can't do that Python, Java and other languages can.
    14. Re:yikes! by JamesOfTheDesert · · Score: 2
      As one of the first posters with +5 comment score points out, you will run into the wall when doing big projects with a scripting language. And despite all the nice OO-like features that have been thrown in to PHP, it still is essentially a script language.

      I didn't see any previous comment explaining how using a scripting lanaguage causes one to "run into the wall when doing big projects."

      This is an old wive's tale, that scripting langauges just don't scale. It's nonsense; while some languages (perhaps PHP) are not well-designed for large projects, others, such as Ruby, do quite nicely.

      Ruby has a a far better OO model than PHP (or Java, for that matter); that one can label it as a scripting lanagauge does not diminish its beauty or power. Give it a shot before dismissing whole categories of tools. Check out these articles

      .
      --

      Java is the blue pill
      Choose the red pill
    15. Re:yikes! by Anonymous Coward · · Score: 1, Funny

      I'm gonna get marked as flaimbait for this one, while php is neat and all.. it's not enterprise ready.

      Yahoo doesn't think so. ;)

    16. Re:yikes! by LDoggg_ · · Score: 1

      Maybe the guy is confusing PHP with python?
      Python can compile to bytecode which can run in a java vm.

      --

      "If they have both, tell them we use Linux. And if they have that, tell them the computers are down." -Dave Chapelle
    17. Re:yikes! by Requiem · · Score: 2

      In the long run

      "In the long run, we're all dead"

      - John Maynard Keynes

    18. Re:yikes! by platypus · · Score: 1

      Don't get me wrong though you PHP and Perl fans, both of those languages are still great at a lot of things and I'm not trying to slam PHP or Perl.

      Ok, you tried to be moderate (what's that called, btw.. unflame-bait?), but let me add the full truth: If you go with pyton+(for instance) zope, you won't look back to perl/php for _any_ task ;).

    19. Re:yikes! by larry+bagina · · Score: 1
      "scripting language" is a loaded term... it implies (too me, at least) that somebody started writing code without understanding the scope of the problem, without proper design. Sure, that can (and does) happen with programming languages like C or Java too, but the compile phase seems to convince peope to think it over (and also, each .c or .java file is more opaque, just showing off a few functions or #defines in the header/java file).

      Smalltalk, Ruby, and scheme are also "scripting" languages, but a lot of big, complex web sites have been written with them.

      Of course, SLASH (perl) is a maintenence nightmare, while PHPNuke, Drupal, etc aren't.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    20. Re:yikes! by twitter · · Score: 1
      0 posts, and already slashdotted? the subscribers must've gotten to that one early!

      And what's with the java comment, PHP is pretty much nothing like java. It has different uses, different strengths, and different semmantics. When are they going to properly fix PHP like making it stable? (*gasp*)

      What a great troll. You admit that you have have not read the article in question, complain about how Slashdot sucks and then complain about the subject. Nice work, you know nothing but you cast dispersions on everything. Comments like this contribute nothing and get in the way of inteligent discusion, so piss off.

      Of course a large portion of the "slashdot effect" comes from the trolls who post slashdotted posts. Nasty little bastards with their silly bots hammering away to prevent information exchange. What a waste of time because it's a game that can't be won. There are too many people who want to share for the few disruptive morons.

      Yep, this is the second time I'm posting this. Eat me, troll.

      --

      Friends don't help friends install M$ junk.

  2. new mysql by minus_273 · · Score: 2, Interesting

    just came out too. a decent combination of better features. My only wish: that there was an easier way to do subselects. I knwo almost every one uses the php+mysql+apache combination when doing stuff on linux. I also know that many others like me are really pissd off about the whole subselects thing. I for one have written my own functions to do similar things in php. I knowmany others who have as well. Im sure php developers could produce a standard way of doing it and make it faster.. oh well

    --
    The war with islam is a war on the beast
    The war on terror is a war for peace
    1. Re:new mysql by Christopher+Cashell · · Score: 5, Informative

      I don't know that "almost everyone uses php+mysql+apache".

      Personally, I much prefer php/perl+PostgreSQL+Apache. And I know I'm not the only one. Sometimes the most popular application isn't the best application (subject to your individual requirements, of course. . . but I've found PostgreSQL to be generally superior to MySQL for essentially all of my needs).

      Oh, and subselects have been working great for me for years now. ;-)

      --
      Topher
    2. Re:new mysql by La+Camiseta · · Score: 1

      I know that many of you don't like to use it, but last I heard, PostgreSQL supports subselects. And from my experience with it, it's extreamely fast and easy to set up and administer.

    3. Re:new mysql by FuzzzyLogik · · Score: 1

      personally i'm a big fan of postgresql... i tried it out because everyone uses mysql and those few who used postgresql always said it was better and they stood by it, which convinced me to try it... i haven't been disappointed by it yet. give it a shot and i believe it supports subselects... what do you have to lose? it's free too.

    4. Re:new mysql by Anonymous Coward · · Score: 0

      Face it, man, MySQL is still junk. Postgres is faster, more scalable, and more featureful.

    5. Re:new mysql by Anonymous Coward · · Score: 0

      Are there any (affordable) virtual hosting type companies that support PostgreSQL? I've looked, and only found really expensive ones, compared to the mysql ones.

    6. Re:new mysql by aoteoroa · · Score: 1

      Lol.

      You're trying to start a flame war on databases right? You almost got me.

    7. Re:new mysql by Fulcrum+of+Evil · · Score: 1

      Are there any (affordable) virtual hosting type companies that support PostgreSQL? I've looked, and only found really expensive ones, compared to the mysql ones.

      Try cqhost.net. It does postgresSQL for $20/mo.

      --
      "We returned the General to El Salvador, or maybe Guatemala, it's difficult to tell from 10,000 feet"
    8. Re:new mysql by Anonymous Coward · · Score: 0

      Thanks!

    9. Re:new mysql by Anonymous Coward · · Score: 0

      It looks like they only start offering postgreSQL in the $34.95 package. The cheaper ones look to only have mysql.

    10. Re:new mysql by kmonsen · · Score: 1

      If you are into Java server solutions give kgbinternet.com a try. You can get a solution for as low as $7 a month ($10 canadian). I have always received good service from them. I think you can use the service for perl/php as well, but I don't need it so I have not checked.

    11. Re:new mysql by Anonymous Coward · · Score: 0

      Oops. My bad.

    12. Re:new mysql by MattRog · · Score: 1

      I prefer PHP/Linux/Apache/Sybase ASE. In our semi-formal testing ASE beat out MySQL and PostgreSQL for our application (web). The ability to use clustered indexes, fine-grained caching, stored procedures, etc. made up for the difference in locking (MyISAM vs. ASE's locking). InnoDB was slower than MyISAM, so we did not bother the entire test suite on InnoDB.

      However, if we had zero cash I'd chose PostgreSQL in a heartbeat.

      --

      Thanks,
      --
      Matt
    13. Re:new mysql by Anonymous Coward · · Score: 0
      My only wish: that there was an easier way to do subselects.

      Easier? That would imply there is a way to do subselects right now, which there isn't.

    14. Re:new mysql by Sembiance · · Score: 1

      Simply the best!
      Go with a webhoster that speciliazes in PostgreSQL web hosting!

      http://www.pghoster.com/

  3. /.'ed? by da3dAlus · · Score: 0, Offtopic

    "This is what I get for running a server on pre-alpha software."

    Well that, and having your website posted on slashdot. Of course it'll crash. Sorry, I'd RTFA if I could get to it...

    --

    Sometimes I doubt your commitment to Sparkle Motion.
    1. Re:/.'ed? by cyb97 · · Score: 1

      But I guess it's great for tracking down those bugs than only appear in RealLife[TM] applications and not on the testbench...

  4. Java? by Anonymous Coward · · Score: 0

    True, true.. Why is no one coming up with real new features in programming languages? It's been a long time since there was anything truely innovative. We're essentially still using constructs that were dreamnt up for computers that had 1k RAM 1 KIPS back in the 60's. Surely with the available processing power we have today, we should be able to make languages far more expressive, easier and safer.

    1. Re:Java? by prowley · · Score: 2, Insightful

      The basis for programming languages is mathematics. Given that, we are doing quite well really. More expressive languages tend to have two downsides that faviour less expressive languages in many a case: 1) they tend to be slower than the same system written in a more traditional language, and no matter how fast processors get, there will always be incentive to squeeze the best performance out of them. 2) they tend to be less general purpose which limits their ability to become ubiquitous. If you have time to learn one language, would you pick a more specialised one which would limit what you could write, or a more general purpose one that allows more flexibility? Those are really the big drivers (or inhibitors) to language take up in my view. Scripting languages tend not to obey those rules but fill the "its either done using a script or it gets done manually" niche, so the performance comparison is different, but still there.

    2. Re:Java? by Anonymous Coward · · Score: 0

      1) they tend to be slower than the same system written in a more traditional language, and no matter how fast processors get, there will always be incentive to squeeze the best performance out of them.

      that's true of some projects that feel they need systems-level features. "what, no pointers? i can't use it now!" some say. sometimes they're right.

      2) they tend to be less general purpose which limits their ability to become ubiquitous.

      you're talking about language goals, not tendancies. some languages are DSLs, or domain-specific languages. perl was not designed to be much more than a text processor, at first. yet some languages are designed to be general purpose. scheme is not particular to any domain.

      If you have time to learn one language, would you pick a more specialised one which would limit what you could write, or a more general purpose one that allows more flexibility?

      it depends. if there's a good dsl for a problem, like php is for dynamic web content, i'll learn php. if not, i'll resort to whatever favorite language i have (be it scheme, C, or whatever). people who religiously stick to one language, in my opinion, waste their time compensating for their language's shortcomings.

      Scripting languages tend not to obey those rules but fill the "its either done using a script or it gets done manually" niche

      a scripting language is a language, just like any other. though its execution may differ from a compiled language, its design goals surely need not. (and i am not clear what makes a scripting language less "manual" than any other. don't you still have to tell a scripting language what to do?)

    3. Re:Java? by stonecypher · · Score: 1

      > More expressive languages tend to have two
      > downsides that faviour less expressive
      > languages in many a case: 1) they tend to be
      > slower than the same system written in a more
      > traditional language, and no matter how fast
      > processors get, there will always be incentive
      > to squeeze the best performance out of them. 2)
      > they tend to be less general purpose which
      > limits their ability to become ubiquitous.

      Er. There are some languages which move the speed problems of given tasks into the tasks rather than letting them plague the entire language. Consider C++; if you don't know what I'm on about, read the ARM.

      Expressiveness isn't anathema to machine speed, it's just that many languages prefer ease of use and maintainability to software efficiency and machine nearness. Languages like C++, Forth, Ocaml, and so on stand as counter-examples.

      --
      StoneCypher is Full of BS
  5. Java by any other name? by PerlPunk · · Score: 1

    And next is a PHP-based J2EE compliant application server.

    1. Re:Java by any other name? by Anonymous Coward · · Score: 1

      Like Java in that it is sharing more and more syntactical arrangements, and the object model is getting very Javalike. Not in the way that the language actually works.

    2. Re:Java by any other name? by FortKnox · · Score: 1

      Its about as similar to Java as Java is to C++. Would you say "C++ by any other name" about Java?

      --
      Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
    3. Re:Java by any other name? by ToSeek · · Score: 1

      No, I just describe Java as "C++ for dummies."

    4. Re:Java by any other name? by FortKnox · · Score: 2, Funny

      Just to keep up the zealotous/elitist flames:
      I describe C++ as "Assembly for dummies."

      Different languages for different applications. I'd like to see you write an enterprise website in C++. Its best to not flame something so ignorantly.

      --
      Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
    5. Re:Java by any other name? by Xerithane · · Score: 1

      Lets just group them all here, this is incredibly funny:
      Basic: Ruby and Python for Dummies
      Java: C++ For Dummies
      C++: C For Dummies
      C: Assembly For Dummies
      Assembly: Machine Code For Dummies

      I have no idea what Perl should be... maybe:
      Perl: Corrupting all that is Good and Righteous in the World for Dummies

      (I code in Perl, often, It's just fun to joke about)

      I'd like to see you write an enterprise website in C++.

      Be careful what you wish for. Just because you can, doesn't mean you should. Also remember, much of Yahoo is C/C++.

      --
      Dacels Jewelers can't be trusted.
  6. Re:that thing was slashdotted with under 3 comment by Anonymous Coward · · Score: 0

    No, it's running PHP5. That's the problem. Still very very alpha.

  7. And, if you want it right now... by oGMo · · Score: 4, Interesting

    And, if you want it right now, instead of waiting for PHP5, go get Ruby today. It's got all of this, and many more neat features. I've recently been moving PHP over to Ruby, because PHP wouldn't scale to a large project (taking 4-5 seconds to load and generate a page on a hefty server, the codebase was only about a meg and a half of PHP), and because it was incessantly segfaulting for mysterious reasons. I've had no such problems since.

    And ruby's a lot of fun... you can use it for tiny scripts, sites, or large projects.

    --

    Don't think of it as a flame---it's more like an argument that does 3d6 fire damage

    1. Re:And, if you want it right now... by Telastyn · · Score: 1

      [offtopic]

      From the little I looked at Ruby a bout a year back it was something that seemed to fit in between PHP and perl in usage and in.... obfuscation. Is this a reasonable generalization?

    2. Re:And, if you want it right now... by lscoughlin · · Score: 1

      And you might not be a troll, but then again, you say such trollish things.

      Anyway, if it wouldn't scale with that little code and a "hefty server", then you did not write code with running.

      I imagine someone else is writing you're ruby code for you as well and all your problems are gone because you're not creating them anymore.

      --
      Old truckers never die, they just get a new peterbilt
    3. Re:And, if you want it right now... by antis0c · · Score: 1

      Specifics? I'm running a large internal PHP project, around 300 PHP files, about 2 megs of PHP code in total, and my page loads are fine, fractions of a second. The biggest bottleneck isn't PHP, but database queries in my project. So I'd like to hear about some specifics on what was causing problems.

      Of course its not fair or valid to say "Well I had these problems 3 years ago so it still applies today"..

      --

      ..There's a-dooin's a-transpirin'
    4. Re:And, if you want it right now... by MxTxL · · Score: 1

      and because it was incessantly segfaulting for mysterious reasons

      Those reasons are undebugged code. No app just mysteriously segfaults (mystery isn't allowed in computers)... if the code was correct, it wouldn't segfault. Might be something minor... and you might have poured over it a million times, but somewhere you're code was still wrong.

    5. Re:And, if you want it right now... by tcopeland · · Score: 1
      Yup, Ruby's pretty cool. This is all generated by Ruby... fun stuff!

      Tom

    6. Re:And, if you want it right now... by jasondlee · · Score: 5, Insightful

      Doesn't scale? I guess someone had better tell Yahoo.

      jason

      --
      jason
      Have a good day?! Impossible! I'm at work!
    7. Re:And, if you want it right now... by oGMo · · Score: 3, Informative
      Those reasons are undebugged code. No app just mysteriously segfaults (mystery isn't allowed in computers)... if the code was correct, it wouldn't segfault. Might be something minor... and you might have poured over it a million times, but somewhere you're code was still wrong.

      You're wrong. No script should cause the interpreter to seg, period. If there's an error condition, it should be reported. A segfault is a bug in the interpreter, no matter how buggy my code is.

      Also, you're doubly-wrong, because statement reordering would sometimes alleviate the problem. Also things like calling get_defined_classes() (or whatever it was called) would segfault on PPC, but not x86. (This was fixed recently.)

      --

      Don't think of it as a flame---it's more like an argument that does 3d6 fire damage

    8. Re:And, if you want it right now... by Cranx · · Score: 1

      Agreed, Ruby is fantastic. Classes/objects, exception handling, namespaces, introspection, oodles of libraries, iterators (these are SO addicting), etc. I've programmed in just about everything, and I can't say enough about this language. Pick up a Ruby book and give it a solid try...clean, fun, easy...can't beat it with a stick.

    9. Re:And, if you want it right now... by oGMo · · Score: 4, Interesting

      Specifics are about the same. Little over 300 files total (only a small fraction of the complete system unfortunately), about 1.5 meg of code. This is not just a simple database interface, though. It's a complete persistant object system, widget framework, with object access controls, interface building, and the like. It makes development very fast, and lets me do things that would be very difficult with straight PHP (or anything else).

      Unfortunately, when it came to building pages themselves, generating them from objects recursively was the final straw. The times really shot up, although they had been building for some time as the codesize and functionality increased.

      With the new Ruby version, most of the processing, including building the pages, is moved to a backend server (written in Ruby), with a thin layer of CGI (in Ruby) that calls it. Loading the interpreter, parsing, calling the backend, processing, returning, and output is down to half a second on my old p2-350. And the capabilities are far beyond what the PHP version had (although, this was in part due to the fact it's a newer version, but some things PHP's object model would not have been able to handle, such as the integration of any given object, and adding syntax for class and method metadata).

      --

      Don't think of it as a flame---it's more like an argument that does 3d6 fire damage

    10. Re:And, if you want it right now... by stonecypher · · Score: 1

      > because PHP wouldn't scale to a large project
      > (taking 4-5 seconds to load and generate a page
      > on a hefty server, the codebase was only about
      > a meg and a half of PHP),

      Sure it will. You just need to use the language well. PHP's got just as many secret places for inefficiency as C++ does.

      That said, since I know you're gonna say "nuh-uh", just look at that Yahoo! just switched over to PHP. It scales. Your code just doesn't. Not the language's fault.

      --
      StoneCypher is Full of BS
    11. Re:And, if you want it right now... by Tailhook · · Score: 1

      Those reasons are undebugged code.

      I spent about six months on a moderately sized B2B site in PHP. I have seen this behavior. In one case Apache would segfault on shutdown. In another, SSL somehow caused PHP to segfault under certain conditions. Yet another had to do with using a COM object from PHP to perform real time credit card transactions. In the first two cases, PHP wasn't at fault. In the last case, PHP handled a return type poorly; if the symbol that pointed to the object was used in a statement as an integer instead of a string it would blow up. That's pretty subtle for a language as weakly typed as PHP.

      I think that your assessment of the posters problem is correct. Somewhere in the code someplace there is an error. It would be better if, rather than mysteriously segfault, PHP provided useful feedback that didn't require a debugger. The fact is that in many of these cases PHP won't.

      This sort of stuff inherently limits scalability in terms of developer productivity. Given n mysterious segfaults per page, you need some number of developer hours to hunt each one down. A similar failure, occurring in JSP/J2EE generally will provide sufficient diagnostic output to shorten this process. In the stateless, containerized world of web development where operating a debugger properly is tricky to say the least, this is a big help.

      --
      Maw! Fire up the karma burner!
    12. Re:And, if you want it right now... by RevAaron · · Score: 1

      Naturally, someone else could tell you to take it to the next level, say goodbye to Ruby, and go with Smalltalk. All of the features (and more) of Ruby in a language that is quite a bit more mature, better acceptance in the world of business, and is generally a lot faster- often due to use of more modern VM technologies than "scripting" languages like Ruby, Perl, or Python generally use. Not to mention web app frameworks that only make you do the neccesary work- far beyond simple templating or anything you can get with Ruby.

      That said, Ruby isn't bad, but if if you're advocating a switch from PHP->Ruby, one may as well finish the evolution and go to Smalltalk...

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    13. Re:And, if you want it right now... by stonecypher · · Score: 1

      > No app just mysteriously segfaults

      This is only true because Win2k is technically an operating system, not an application.

      (ducks!)

      Yeah, you were making a valid point. But mine is funnier.

      --
      StoneCypher is Full of BS
    14. Re:And, if you want it right now... by Anthony+Boyd · · Score: 1
      PHP wouldn't scale to a large project (taking 4-5 seconds to load and generate a page on a hefty server, the codebase was only about a meg and a half of PHP)

      I agree with Tilde, antis0c, and jasondlee, who all responded to your post. I think you're trolling, I think you really didn't have the problems you said you did with PHP, and I think that even if you did have those problems, I have an extrememly hard time believing it's PHP's fault. In addition to the other people who responded with large sites running large codebases very quickly, at SST we have about 5 megs of code, and it's pretty responsive even with 60 simultaneous users. We have a couple spots that can take a few seconds to display, but that's usually from doing 500 recursive queries (cascading down an org chart, for example). Mostly we display pages in under 1 second.

    15. Re:And, if you want it right now... by RevAaron · · Score: 1

      Nope, you can't beat Ruby with a stick, but you can beat it with a Smalltalk! ;)

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    16. Re:And, if you want it right now... by Gortbusters.org · · Score: 1

      How would an apache segfault be any different?

      --
      --------
      Free your mind.
    17. Re:And, if you want it right now... by sporty · · Score: 4, Insightful

      You don't know how yahoo uses php. It might use it on command line for generating static pages. So beware what you think they are doing. You never know.

      --

      -
      ping -f 255.255.255.255 # if only

    18. Re:And, if you want it right now... by pi_rules · · Score: 1

      Ah hem, but you're wrong. Well, a little bit right. No script should segfault the interpreter, but there's no good way I know of to keep the interpreter from segfaulting when the script makes calls to functions that drill down into shared libraries or .dll's. As long as something's in the same process it can take the whole thing down with an invalid memory access. I see it all the time in Java code using JNI to get at Win32 .dll's. It sucks, yes, but it's not the interpreter's fault.

      Now, today I'm running a Java application under a web application server and the server would just die -- with no error message. Nothing, not a single line of output. It just exited, logging nothing to a file nor to screen. -THAT- is horribly unacceptable.

    19. Re:And, if you want it right now... by RevAaron · · Score: 1

      You're wrong. No script should cause the interpreter to seg, period. If there's an error condition, it should be reported. A segfault is a bug in the interpreter, no matter how buggy my code is.

      Indeed- I think the person to which you are replying either a) is used to mightily shitty scripting languges or b) is used to C/C++, where segfaults show up unexpectedly all too often.

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    20. Re:And, if you want it right now... by 1stvamp · · Score: 1

      When the Yahoo! switch was happening, Yahoo! posted rather detailed notes and presentations of exactly how they were using PHP to generate and display their content. Don't have a link handy right now though.

      --
      Wes
    21. Re:And, if you want it right now... by antis0c · · Score: 1

      Ah, I see. Yes, I developed a widget framework system using Objects, basically an object for each available XHTML element, attribute management, then more complex objects built off the XHTML Element objects to create complex forms and interfaces. PHP's single greatest bottleneck with speed is Zend 1's object creation. Creating around 100-200 objects dynamically takes 5 - 6 seconds to do.

      So I created a complicated caching system to eliminate this. However, Zend 2, the engine in PHP 5 has a completely redone OO system. This makes it lightyears faster. I agree though Ruby is a focused OO system, however I enjoy PHP's procedural aspects as well. To each his own though.

      --

      ..There's a-dooin's a-transpirin'
    22. Re:And, if you want it right now... by oGMo · · Score: 4, Informative
      Ah hem, but you're wrong. Well, a little bit right. No script should segfault the interpreter, but there's no good way I know of to keep the interpreter from segfaulting when the script makes calls to functions that drill down into shared libraries or .dll's.

      There is an easy way. You catch the signal 11, and send an error to the script saying that something happened in the library that wasn't the interpreter's fault.

      The interpreter should not just crash and return no useful output, like PHP was doing.

      As long as something's in the same process it can take the whole thing down with an invalid memory access. I see it all the time in Java code using JNI to get at Win32 .dll's. It sucks, yes, but it's not the interpreter's fault.

      Maybe in Windows this is the case, but not Unix, where you can catch a segfault and do a longjmp to an error handler. Tidy and easy.

      Now, today I'm running a Java application under a web application server and the server would just die -- with no error message. Nothing, not a single line of output. It just exited, logging nothing to a file nor to screen. -THAT- is horribly unacceptable.

      I completely agree. This is exactly what PHP was doing.

      --

      Don't think of it as a flame---it's more like an argument that does 3d6 fire damage

    23. Re:And, if you want it right now... by Anonymous Coward · · Score: 0


      <?php

      class foo
      {
      function foo()
      {
      for ($i = 100; $i; --$i);
      }
      }

      for ($i = 200; $i; --$i)
      $bar[] = new foo();

      var_dump(count($bar));

      ?>

      fuck@slashdot (~) $ time php ~/test.php
      int(200)

      real 0m0.073s
      user 0m0.070s
      sys 0m0.000s

      So, does Zend's object manager have the problem, or does yours? You wouldn't
      have a test case that can reproduce the 'problem', would you?

    24. Re:And, if you want it right now... by outsider007 · · Score: 1

      You don't know how yahoo uses php. It might use it on command line for generating static pages

      yes, that's it. every time someone hits a yahoo page, there's a little gnome running a command line and sending it back. it's actually very cost effective since they work for underpants.

      --
      If you mod me down the terrorists will have won
    25. Re:And, if you want it right now... by oGMo · · Score: 1
      PHP's single greatest bottleneck with speed is Zend 1's object creation. Creating around 100-200 objects dynamically takes 5 - 6 seconds to do.

      Odd, I ran a few tests initially to see if it could handle making lots of objects really fast, and it didn't seem like a problem. Since there's no easy way to profile code (unlike ruby), I figured the bottleneck was the text tag processing and recursion, as things went really downhill at the same time.

      The widgets I make are one per "thing", where a "thing" isn't necessarily a tag. You can have Table, Row, Form, OptionList, etc, some of which map to one tag, others map to many. Makes doing the UI really quick. I hate HTML. :-)

      So I created a complicated caching system to eliminate this.

      I cached stuff as well---all the persistant loads from the database. It was way worse without, long before. With the new system, the backend caches objects from all volumes, and since the backend persists, that part is even faster. I didn't even bother trying without caching.

      --

      Don't think of it as a flame---it's more like an argument that does 3d6 fire damage

    26. Re:And, if you want it right now... by Tailhook · · Score: 1

      I attributed that problem to some binary compatibility problem between Apache and the PHP module. I recompiled both on the same host using the same compiler and the problem vanished. It was a pain because the server was IHS (IBM HTTP Server,) which is just Apache bundled with some proprietary modules. To whom to attribute such a problem? God knows. Not me.

      --
      Maw! Fire up the karma burner!
    27. Re:And, if you want it right now... by rycamor · · Score: 1

      Actually, there is one (overcomable) oddity with PHP that might cause these problems: PHP defaults to object spawning by copy rather than by reference. Thus when PHP developers do $myobj = new myclass;, they would usually be better off doing $myobj =& new myclass;, which will create objects much more efficiently, and behave more like Java in object creation.

      In PHP5, objects will automatically be created by reference, so this won't be such a common problem.

    28. Re:And, if you want it right now... by Malcontent · · Score: 1

      "And the capabilities are far beyond what the PHP version had (although, this was in part due to the fact it's a newer version, but some things PHP's object model would not have been able to handle, such as the integration of any given object, and adding syntax for class and method metadata)."

      I don't know exactly what you mean by this but PHP does support changing objects at runtime. For example you can do sort of a mixin-type-thing as illustrated here

      --

      War is necrophilia.

    29. Re:And, if you want it right now... by Malcontent · · Score: 1

      It's not the fault of PHP if the developers don't read the manual and learn the language.

      --

      War is necrophilia.

    30. Re:And, if you want it right now... by Trifthen · · Score: 1

      Doesn't scale... yeah right. That's why we serve over 1000 newspaper websites that make use of our news engine and multiple other applications all written in a PHP class architecture. Go ahead and try to Slashdot any of the sites we host.

      This isn't an article about Ruby, so stop whoring out your favorite language and let it wait its turn. Don't slam PHP unless you know what the hell it can do if used properly. I mean, seriously...

      --
      Read: Rabbit Rue - Free serial nove
    31. Re:And, if you want it right now... by ftzdomino · · Score: 1

      "Maybe in Windows this is the case, but not Unix, where you can catch a segfault and do a longjmp to an error handler. Tidy and easy." From the man page of signal: "According to POSIX, the behaviour of a process is undefined after it ignores a SIGFPE, SIGILL, or SIGSEGV signal that was not generated by the kill() or the raise() functions." This may work in linux, but it's definitely not "unix" and probably not portable.

    32. Re:And, if you want it right now... by 1stvamp · · Score: 1

      That's the one.

      --
      Wes
    33. Re:And, if you want it right now... by new-black-hand · · Score: 1

      This makes it lightyears faster. "Lightyears" is a distance.

    34. Re:And, if you want it right now... by antis0c · · Score: 1

      It's also a metaphor to mean "A LOT", or "extremely long". My case, A LOT.

      And to split hairs, the definition also defines it as a period of time too which can be used to express speed based on distance and time.

      From Webster's Revised Unabridged Dictionary (1913) :

      Light year \Light year\ (Astron.)
      The distance over which light can travel in a year's time; --
      used as a unit in expressing stellar distances. It is more
      than 63,000 times as great as the distance from the earth to
      the sun.


      To sum it up, Traveling 63,000 times the distance from the Earth to the Sun in one years time is fucking fast.

      --

      ..There's a-dooin's a-transpirin'
    35. Re:And, if you want it right now... by alexander+m · · Score: 1
      PHP wouldn't scale to a large project
      yes, that must be why Yahoo are migrating chunks of their setup to PHP -- because it doesn't scale well. after all, they only receive 1.5 billion page views a day. lucky they don't have the kind of traffic your site gets, otherwise this migration would never work!

      (i do actually love ruby by the way, but saying php doesn't scale?! you are smoking strong crack, my friend... :)
    36. Re:And, if you want it right now... by sporty · · Score: 1

      Between the truth of your statement, and your use of sarcasm/satire.. I'm not sure if I'm being trolled or intelligently talked to...

      stupid underpants gnomes never knew what they were doing anyway.

      --

      -
      ping -f 255.255.255.255 # if only

  8. not java by Suppafly · · Score: 0

    michael should just not post commentary to the stories that he posts, php is definately java by any other name.

    1. Re:not java by spencerogden · · Score: 1

      If you looked at the posted you'd realize the java comment was made by the submitter, not the editor.

    2. Re:not java by chrisseaton · · Score: 1

      "php is definately java by any other name"

      I can't see how you think PHP is Java "by any other name" - the whole perspective is different. Java lives for objects - in PHP they're an afterthought.

    3. Re:not java by Phil.Roberts · · Score: 2, Informative

      An afterthought that they decided to base an entire re-write of the core PHP engine around....

    4. Re:not java by Anonymous Coward · · Score: 0

      It's the syntax that's important to me. Did they change all of that too, or is it as hacked on as Perl's OO?

      Ruby's the best OO scripting language in wide use right now, IMHO.

    5. Re:not java by chrisseaton · · Score: 1

      I agree with the "hacked on thing"

      It's called "object _orientated_" for a reason - not "with objects"

    6. Re:not java by Anonymous Coward · · Score: 0

      If you're going to make such a point over wording, at least use the right word.
      "_oriented_"

    7. Re:not java by RevAaron · · Score: 1

      Umm, I don't know anyone who calls anything object _orientated_" except for maybe frosh CS majors who really don't know how to code you.

      It's "object oriented," and whether a language supports objects (and therefore OOP) or is fundamentally OO is just a question of the way the standard libraries present the language's capabilities to you. I've not been able to read the article and derive if they're rewriting the PHP libs to be object-based, or if they're just finally adding support for OOP.

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
  9. Sterling Hughes' blog says by TDScott · · Score: 1

    "this [the talk] is hosted on NYPHP's servers... and is running Apache 1.3.27 + PHP5. PHP5 leaks worse than the Titanic..."

    And you linked to it from Slashdot and expected it to survive long enough so that any non-subscriber could click on it?!

  10. not really by g4dget · · Score: 2, Interesting

    Java has a static type system (compile-time type declarations). PHP5 presumably still has a purely dynamic type system (but the site isn't responding...).

    1. Re:not really by Anonymous Coward · · Score: 0

      In reality, Java has just as much a dynamic type system as PHP does. You can compile to bytecode, which checks types statically, but there are many checks that go on during runtime.

      Many times, not only does it require the classes/interfaces to match at runtime, but also sometimes even the classloaders themselves.

      Steve

    2. Re:not really by g4dget · · Score: 1
      In reality, Java has just as much a dynamic type system as PHP does.

      No, in reality PHP lacks a static type system, while Java has one.

      And, in reality, even the dynamic type information Java has is far from equivalent to PHP's, because in Java, the type of the object matters, while in PHP (and most other scripting and dynamic languages), only the behavior matters.

      In short, in reality, the two type systems are very different.

    3. Re:not really by g4dget · · Score: 1

      Sorry, that may have been a little too cryptic; to clarify: "in PHP only the behavior matters for substitutability".

  11. We need good examples by phorm · · Score: 3, Interesting

    Hopefully... PHP5 will either address some of the common mistakes (without becoming brainless) or at least have some good example out there.

    If anyone has noticed... one of the major areas of death/slashdotting of sites apart from bandwidth are php URL's... and/or mySQL queries (often on PHP URL's). I've not yet noticed many Perl-run pages that have been slashdotted so successfully as PHP.

    Now, I'm not sure if that's a faultof PHP itself, or that some of the "easier" features of PHP tend to attract less competent programmers and/or misconfigurations?

    1. Re:We need good examples by stonecypher · · Score: 2, Insightful

      > Now, I'm not sure if that's a faultof PHP
      > itself, or that some of the "easier" features
      > of PHP tend to attract less competent
      > programmers and/or misconfigurations?

      Arguably, it's most likely because PHP is built into Apache by default, so lots of people running a server out of their dorm room use it. PHP is the most likely scripting environment on small machines because, let's be frank, Tomcat is a huge pain in the ass to set up.

      That said, like C++, PHP is a language which is very easy to put hidden ineffiencies into. So that may compliment the problem.

      --
      StoneCypher is Full of BS
    2. Re:We need good examples by Anonymous Coward · · Score: 0

      PHP is not a part of Apache by default. It may be installed in some distributions that way, but that's something else entirely. The problem maybe simply that there are more PHP pages (thus more of them to Slashdot), and PHP is probably easier to learn/use for many, and new users are unlikely to plan for these sorts of things.

      Personally, I put together a mini-cache system in PHP so that it shouldn't ever overload the database.

    3. Re:We need good examples by stonecypher · · Score: 1

      > PHP is not a part of Apache by default.

      Sorry, what I should have said was that there was a distro of Apache with PHP built in that's pre-built and ready for most platforms.

      And honestly, in my opinion, thta's just as good as. But you're right to raise the error flag.

      --
      StoneCypher is Full of BS
    4. Re:We need good examples by mshiltonj · · Score: 4, Informative

      If anyone has noticed... one of the major areas of death/slashdotting of sites apart from bandwidth are php URL's... and/or mySQL queries (often on PHP URL's). I've not yet noticed many Perl-run pages that have been slashdotted so successfully as PHP.

      PHP will run in just about any hosted environment. It is nearly ubiquitous in any shared hosting package.

      Machines used in virtual hosting packages (in the < $50 price range) usually have the web server and the db on one machine with less than a GB of memory, and have upwards of a couple dozen or more sites running on the same machine.

      For many, if not most, sites, especially the non-commercial sites, this is more than necessary. They can be incredibly complex and completely dynamic sites. Such is the power of PHP, it puts great power into meager hands.

      In meager hands, however, one quickly runs out of resources.

      Perl, on the other hand, and more specifically mod_perl, isn't usually in these virtual hosting packages. Why? Because mod_perl really gets into the the guts of apache, and anything really neat requires non-trivial modifications to the httpd.conf file. (not just an .htaccess file)

      Sites that use mod_perl, then, usually have thier own dedicated machines, and in those cases will usually have _multiple_ machines dedicated to serving a site.

      For instance, Slashdot is run using 10 different machines.

      You'll have to stress test PHP vs. mod_perl on like hardware before drawing any conclusions
      about slashdot-resistance.

    5. Re:We need good examples by Christianfreak · · Score: 1

      Now, I'm not sure if that's a faultof PHP itself, or that some of the "easier" features of PHP tend to attract less competent programmers and/or misconfigurations?

      I think that's one of the big problems. People are moving to PHP in droves because its so "easy" and so "fast", which is really just marketing hype. It is easier to do small simple things, the "function_name_for_everything" model it follows is easy for HTML people to understand and get the hang of but try doing a large application and then try maintaining it a year later. Yeah right.

      It is possible to program PHP modularly and correctly but it takes more time, things like the Pear DB module while good are poorly documented, other Pear modules aren't documented at all. The Pear people seem to worried about making sure your tab stops are a certain width than proper documentation. (BTW Pear can't light a candle to CPAN).

      But what do I know, I'm probably bitter because I'm forced to use PHP at work.

    6. Re:We need good examples by Arethan · · Score: 4, Interesting

      Slashdotting occurs mainly because 1 of 2 things happens. Either a) the pipe to the webserver is too small and the traffic overwhelms their connection; or b) the hardware falls behind in servicing the requests, and thus pages start failing.

      Usually, it's b). Particularly, database queries being the main culprit. When people write database backended websites, they take 1 of two approaches. Make calls to the database every time a page is requested (most used), or they call the database for the first request, caching the result, and feed the cached copy to all other requests that occur within the cache's lifetime.

      Method 1 is easier to do, but is flawed, in that you are placing all of the load on the database server. Once the requests start to pile up, it immediately becomes a bottleneck.

      There was a nice write up about how some group put together a slashdot proof system, consisting of only modest Sun hardware. Their key was the use of java to run the website. Java allowed them to create system-wide objects that could be referenced by unrelated page requests. So they took method 2 in website design, and had a system that only made calls to the database when the cache didn't already hold a requested page.

      PHP4 (and 3), unfortunately, do not allow for persistant system-wide objects. Not even lowly variables. So you can pretty much bet that any stock webserver using PHP will not handle a slashdot link on it's own. It would need a caching server to keep the requests to the database at a minimum. Hopefully, PHP5 will fix this little problem, as even ASP allows for system-wide objects.

      So the short answer to your last question is: It is the fault of the programmer for choosing the wrong model, but PHP doesn't give them any other option, making their only alternative to use a different language.

      Hope that helps. :)

    7. Re:We need good examples by _fuzz_ · · Score: 1

      I've not yet noticed many Perl-run pages that have been slashdotted so successfully as PHP.

      Due in large part to the fact that PHP is used a whole lot more than Perl for web sites. I doubt the language has all that much to do with it.

      Most performance problems in dynamic (Java/PHP/Perl) websites that I've seen are because the database isn't indexed properly.

      --
      47% of all statistics are made up on the spot.
    8. Re:We need good examples by RetroGeek · · Score: 1

      PHP4 (and 3), unfortunately, do not allow for persistant system-wide objects.

      And this is the major shortcoming of PHP for framework based systems.

      I wrote an app which used National Language Support (NLS), used constants for all the "magic numbers", dynamically generated a nested DHTML menu, and so on. When page load times started approaching .8 seconds, I segmented the NLS calls, put switch/case statements around the constant definitions, the SQL file includes, and got the page load times down to .6 seconds.

      The actual target page load time was under .1 seconds. The rest of the load time was the app framework. By trying out various tests, the main culprit was .... variable memory allocation. As the number of variables rose, the page load times rose. To give the PHP programmer's credit, it was almost perfectly linear. But the number of variables was the problem.

      In a Java environment I could load all the NLS calls, constant definitions, etc, at app load time. Once. Then use them as system objects as required.

      So why did I choose a framework based approach? Because it is the easiest for long term maintenance, IMHO. And I was also trying to create a portable framework for use on other projects.

      --

      - - - - - - - - - - -
      I am a programmer. I am paid to produce syntax not grammar. Deal with it.
    9. Re:We need good examples by rtaylor · · Score: 1

      PHP has had pretty good Shared Memory support for quite a while. Shared memory is plenty fine in this case since most sites only have a few megs of commonly used data.

      Shared memory is a perfectly valid fix for this issue -- but you usually cannot use it on shared hosting packages -- but you cannot do the Java thing either in most cases...

      --
      Rod Taylor
    10. Re:We need good examples by zerocool^ · · Score: 1

      Actually, slashdot is running more than 10 computers. I posted this comment, poking fun at an editor a while back. Rob wrote back and posted this comment, saying that they were using more than the FAQ said. Appearantly, the FAQ is out of date.

      But, as to seeing php pages fail, yes, it happens. I think it's a lot of what you say - for example, where I work, our shared server that runs linux serves ~90 different sites, and yeah, we support mod_perl and postgres, but almost all people use php/mysql. Perl tends to be very heavy on the system (because of all it does), but even so, under moderate load, perl sites still work fine. It's just that there's a threshold that, when you cross it, you kill a machine running mod perl. Whenever a site we host is slashdotted, and it's running perl, it's not just bandwidth issues, it's the machine comming to a screeching slam as it processes the requests. PHP does the same thing, but not with a threshold like perl, in my expierence, the drain on the system increases in a linear fashion.

      The machine is a 1.4 P-4 w/ 640 MB of RDRAM. No one likes the P-4, and it's not the most efficient chip, but it was new and top of the line at the time. But, even so, at noon earlier today, the load on the system was below .10. Right now, it's high, because it's running dumps/gzips for amanda. But, the machine is by no means overloaded.

      --
      sig?
    11. Re:We need good examples by Post-O-Matic · · Score: 1

      And I've never seen so many segfaults and exceptions as with programs written in C#...

      --
      "My mom always said that there are no monsters - no real ones - but there are !"
    12. Re:We need good examples by fferreres · · Score: 1

      Not to mention most sites run PHP+MySQL, so while you are right the point is 100% redundant.

      --
      unfinished: (adj.)
    13. Re:We need good examples by fferreres · · Score: 1

      It is very easy to cache the queries you can afford to cache in a simple way. Take a look at PEAR, there's an example implementation. I used it and it works most of the time. You can even set it up in a way that the cache gets activated when load starts to get higher than desired.

      --
      unfinished: (adj.)
  12. Java by any other name? by FortKnox · · Score: 1

    I'm actually OFFENDED that you would compare PHP5 to Java. I don't want to start rambling off the difference (though I will mention EJB and taglibs, just to put something in the hat).
    I'd rather ask the submitter if he'd like to truely argue why he thinks this new version of PHP is just like java.

    --
    Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
  13. Java? Hardly. by Graelin · · Score: 3, Interesting

    Java by any other name...

    Leave it to a Perl guy to compare PHP to Java.

    features in PHP5; highlights include the new object model, namespaces, interfaces, access control and exceptions.

    Of course, Perl has had all this for some time.

    Just curious, how can you have an object model without namespaces? Or interfaces for that matter? Isn't that like "New Car - with tires!"??

    Either way, PHP makes for a good interface language for web apps - I guess. You can throw it on top of an application layer to do the real work. Last I checked, you could only use SOAP to do this - has anyone tested how well that performs? SOAP doesn't scale all that well.

    It would be nice to let the HTML monkeys handle some of this stuff while the serious development can take place in a real language. /me dawns the flamesuit.

  14. Suexec-like support? by MasterSLATE · · Score: 2, Interesting

    Does anyone know if this version will have better support for suexec-style permissions handling without using php as a perl module script thing? If I'm unclear, what I mean is will php commands like chown and chmod actually be functional on files not owned by the user apache runs as, based on the user who owns the site/scripts?

    --

    [sig]www.masterslate.org[/sig]
    1. Re:Suexec-like support? by ShotgunEd · · Score: 1

      PHP has a semi-equivalent functionality already built in. You can set the open_basedir directive. It limits a script's ability to perform file operations based on the directory set, or the working directory of the script. For example, if you set it to "." (meaning working directory), and script resides in /home/fred/html/, that script will only be able to mess with files in it's that directory and below. It's definitely not the same as SuExec, but it's a decent way of limiting the permissions of script based on who owns it - assuming, of course, that the script's path somehow reflects who owns/created it. More from the site

    2. Re:Suexec-like support? by KillNateD · · Score: 1


      Uh, if it's running as a module in the webserver, you can't have it run with any permissions outside of the webserver's. Because it's running inside the same process.

      You can use suexec w/ PHP if you run it in CGI mode because it's then running in a separate process that suexec can setuid to your user/group.

      I work for a web hosting company and hate PHP mostly because most PHP developers are complete idiots.

    3. Re:Suexec-like support? by MasterSLATE · · Score: 1

      Close to what I meant, but not exactly. You can't chmod/chown/etc files in that path UNLESS they are owned by the user that the apache process is running as.

      --

      [sig]www.masterslate.org[/sig]
    4. Re:Suexec-like support? by PinkX · · Score: 1

      Take a look at the open_basedir directive in php.ini, it will allow you to specify the relative root path for which PHP has access to files.

      Of course this would be useless if you couldn't set it on a per virtualhost basis (asuming you use Apache):

      <VirtualHost www.masterslate.org>
      ServerName www.masterslate.org
      DocumentRoot /home/web/masterslate.org/htdocs
      <Location />
      php_admin_value open_basedir "/home/web/masterslate.org/:/usr/lib/php/"
      &lt/Lo cation>
      <VirtualHost>


      That would do the trick.

  15. LAMP ... what about JOLA by Anonymous Coward · · Score: 0

    Ok...I know about LAMP. This is fine in the "web" community. What do /.'ers think of JOLA (Java Oracle Linux Apache) for the corporate environment.

    Before the flames start, I have talked to a quite a few IT managers and they are very reluctant to try open source. Since Oracle and Java are mature, why not toss in only two open source solutions (Linux and Apache). Ease it in slowly. Then, when they don't expect it, hit them with mySQL or PostgreSQL and then PHP :)

    Comments?

    1. Re:LAMP ... what about JOLA by winkydink · · Score: 1

      Given that the cover of the March 15th issue of CIO magazine is titled "Your Open Source Plan", I'd have to say more IT managers are thinking about it than you are of. Worth a read, IMHO.

      --

      "I'd rather be a lightning rod than a seismometer." -Ken Kesey

    2. Re:LAMP ... what about JOLA by MmmmAqua · · Score: 4, Informative

      Here's what I think...

      I work for a company that uses both systems - LAMP for webservers, PJOLA (PHP/Java/Oracle/Linux/Apache) for the internal office/admin/order system, with some interesting interactions between the two systems.

      For example, product data and changes originate in the internal system, get sent from Oracle to a MySQL master DB through an ODBC link, then the MySQL master propagates the changes down to the webservers, which are MySQL slaves. The flow of orders from MySQL to Oracle is less complicated, as each webserver transfers its orders directly to Oracle through an ODBC link.

      These are just two of the interactions with external data involved in our system (data external to Oracle, that is). Here is why we don't use MySQL internally:

      It's not ready for enterprise use. Flame me all you want, but that's the simple truth. Without subselects, built-in OLAP, a comprehensive data dictionary (which is crucial for system auditing), comprehensive tracing features (ditto), hot-standby failover support, clustered database support, and a dozen other things, MySQL is not suited to mission-critical environments.

      It's fine for our webservers, where it is important to have a lightweight, fast database server, but not for the really important stuff; I can lose a webserver, no problem - there are several more I can redistribute the load to - but I absolutely cannot lose my office/order system. MySQL can't provide a reasonable guarantee of my data's integrity and security, so I'm not using it.

      As for PostgreSQL - when we first started developing our system, we came down to two databases for the internal side: Oracle8i and PostgreSQL. We ended up choosing Oracle for performance reasons, and for clustered database support. PostgreSQL is a full-featured, stable, capable database, but it can't keep up with Oracle for speed or features. Example: Oracle9i's XMLDB - a huge boon to systems which do a lot of business-to-business (sorry, but I hate the B2B B2C, etc. crap) data interchange. Much of today's interchange is done in XML, and the ability to treat an XML file as just another table is a huge effort and timesaver. Oracle isn't the only database with XML support, but it is the only one I know of that allows you to join an XML file to an internal table for queries.

      So, flame away, I'm wearing my asbestos underpants. But those are the facts as I see them.

      --
      Arr! The laws of physics be a harsh mistress!
  16. url by Anonymous Coward · · Score: 0

    Link doesn't seem to work.

    Suggest you paste this into your browser's address bar.

    http://talks.php.net/show/php5intro

    1. Re:url by Anonymous Coward · · Score: 0
  17. Did you try acceleration? by Anonymous Coward · · Score: 0

    PHP Accelerator is really quite good, and is free. It compiles the code once, and then caches that for each load.

    1. Re:Did you try acceleration? by King+of+the+World · · Score: 1

      There are about 5 op code caches about for PHP.

  18. Re:that thing was slashdotted with under 3 comment by Chester+K · · Score: 5, Funny

    Either most slashdot readers are now actually reading the articles

    It's a new feature of PHP5 ... Anticipatory Slashdotting.

    --

    NO CARRIER
  19. Re:Java? Hardly. by Fammy2000 · · Score: 3, Funny

    Wait. You don't have to pay extra for tires? =)

    I'm still trying to figure out why I had to pay extra for floor mats.

    --
    If I had something intelligent to say, I would have said it.
  20. Re:slashdot needs to start mirroring pages by Anonymous Coward · · Score: 0

    Slashdot authors need to get a clue. Don't link to an obviously quoted pre-alpha server.

  21. Who cares? by insecuritiez · · Score: 1, Troll

    PHP 4 and previous versions taught most of us that if you run it even a 13-year-old script-kiddy can 0wn your site. New version, new features aside, PHP can't catch on much more than it has until more of the holes in it's implementation are patched. Would any of us buy a fancy car without locks? PHP is much the same, really nice to use but without security is it worth it?

    1. Re:Who cares? by Lordrashmi · · Score: 2, Interesting

      Are you a troll or would you care to point out all the security holes?

    2. Re:Who cares? by AllMightyPaul · · Score: 1

      So that's why PHP is the most popular module for Apache!

    3. Re:Who cares? by insecuritiez · · Score: 1

      This will outline many of them.

    4. Re:Who cares? by stonecypher · · Score: 2, Insightful

      > PHP 4 and previous versions taught most of us
      > that if you run it even a 13-year-old script-
      > kiddy can 0wn your site.

      Unless of course you have another thirteen year old doing security at your site. PHP is arguably just as hard to get into as Tomcat, ASP, or most CGI applications (read: not very difficult at all.)

      This has more to do with the software written in the language than the language itself. Yes, I know there have been many PHP security holes; there have been security holes for *everyone*. Progressive squashing is the name of the game, and if you're not QMail, you're part of the problem.

      Don't blame industry problems on one language, please. It's obnoxious.

      --
      StoneCypher is Full of BS
    5. Re:Who cares? by Anonymous Coward · · Score: 0

      Security flaws as the result of script writers are not the same thing as security flaws in PHP itself. PHP is working to educate programmers to some of the dangers, (ie better global variable handling), but they can't keep everyone from making mistakes and/or bad decisions.

    6. Re:Who cares? by Lxy · · Score: 1

      I did check out that link, thank you. As always, there were plenty of vague sources like PCworld who basically said it was flaws, but wouldn't give any clues as to why.

      Reading the first page of links, my assumption is this. You are vulnerable A) if you're not staying on top of new releases or B) you're writing code that's not being sanity checked. I learned PHP by the seat of my pants, and on my very first PHP application I realized that anyone can squeeze data into a PHP script. So, make sure your checking is all done on the PHP script being executed, not on the form being sent. As was pointed out, it's very easy to want to do stuff like www.mysite.com/page.php?page=bio.php. That in itself isn't unsafe, just make sure you're checking the input strings for validity. Of course, using #includes is a much safer way to do it, but to each his own.

      Stay patched and learn to code safely. Sounds like any other language I've ever heard of, so why pick on PHP? Compared to other security flaws in a linux system, why do we need to pick on PHP?

      --

      There is no reasonable defense against an idiot with an agenda
      :wq
    7. Re:Who cares? by Anonymous Coward · · Score: 0

      What's interesting is that the link you give to Google doesn't talk about PHP security holes, but mostly security holes in applications written in PHP because of bad coding. The two are very different.

    8. Re:Who cares? by caluml · · Score: 1
      As was pointed out, it's very easy to want to do stuff like www.mysite.com/page.php?page=bio.php. That in itself isn't unsafe...

      So why not do /page.php?page=bio
      Then in page.php you can include("/home/site/$page.php"); after pulling in the $_GET["page"] variable, as of course register_global_variables is off, isn't it? :)
      Then any files they want to read have to end in .php. Unless they get very cunning, and start trying %00 stuff, which I'm not sure works anyway.

    9. Re:Who cares? by rycamor · · Score: 1

      Actually, there have not been that many security holes in the core PHP code itself. I have been using PHP for 5 years, and there have only been a handful of security alerts requiring patches.

      The real problem is the code written in PHP, by 13-year-olds, who haven't been introduced to all the dangers inherent in any scripting system that processes input from users. PHP is just so easy that it is easy to write insecure software. The flaw, if there is one, is mainly that.

    10. Re:Who cares? by ubernostrum · · Score: 1
      I see . . . now, I'm going to go write a PERL script that allows anyone in the world to download /etc/passwd. After I've done that I'll put up "PERL IS INSCURE! PERL FULL OF SECUrITY FLAWS! USE PERL AND GET R00TED!" pages all over the web, so I can make exactly the same argument . . .

      Seriously, if you turn on safe mode (which is enabled by default on all recent versions of PHP) and have half a brain, PHP's just as secure as anything else out there. If you're brain-dead and set register_globals on, don't validate incoming data, etc., then you deserve what you get; don't blame it on the language.

  22. Not doing much to improve my opinion... (/.'ed) by tweakt · · Score: 3, Funny

    The connection was refused when attempting to contact ny1.php.net

    I tried to RTFA, and all I got was this lousy error message.

    1. Re:Not doing much to improve my opinion... (/.'ed) by Anonymous Coward · · Score: 0
      Bear with me for a moment while I explain to you why I don't like Negroes. Don't get excited. Let me explain.

      The plain fact of the matter is that I don't like Negroes. Now before you get on your high horse and start screaming "racism", let me have my say.

      It is the Negro culture to which I can not relate.I don't like the way a Negro looks. I don't like the way they talk. I don't like their music. As far as I can tell, when measured by objective standards, the Negro culture is quite primitive.

      This is my personal opinion. You don't have to agree with it. It is my opinion however, and it is the way in which I view things.

      You can scream and yell, but it won't change my mind one bit. I am entitled to my personal preferences, and I don't prefer Negroes. At all. Period.

  23. Re:slashdot needs to start mirroring pages by colin_n · · Score: 1

    If slashdot mirrored pages that people want to see, then we might end up slashdotting slashdot. I only load up the page once and then link to all the articles. If you think that one article is approximately the same size as slashdot (possibly bigger if it has screenshots), and I do 4 click throughs per slashdot session. If you can assume that each user would require 5 times more bandwidth... then even slashdot might have a problem.

    --

    --------- I have no signature
  24. Nice and stable by Bob+Bobbinson · · Score: 5, Interesting

    From the blog :

    PHP5 isn't ready

    This is what I get for running a server on pre-alpha software.

    Ok, so as many of you already know, I have my talk for NYPHP online. This talk is hosted on NYPHP's servers, and is running Apache 1.3.27 + PHP5.

    PHP5 leaks worse than the titantic. With MaxRequestsPerChild at 100, apache children grew to 37MB (before we stopped counting). At MaxRequestsPerChild at 40, it was around 27mb. Finally, we've settled on a reasonable default 25 requests per child. MaxClients at 50.

    This is a box that can easily handle 20 times this load. ugh.

    PHP5 is pre-alpha. Don't think otherwise.

    1. Re:Nice and stable by Professor+Bluebird · · Score: 1
      PHP5 leaks worse than the titantic.


      Does it leak as much as the Itanic(TM)?
  25. is PHP5 ZOPE? by y2rayk · · Score: 1

    I know that zope is great for dynamic content. Is the new PHP better?

  26. nice by eille-la · · Score: 1

    i'll begin doing some php only when microsoft will have released Visual MSPHP. Thats it.

    1. Re:nice by stonecypher · · Score: 1

      > I'll begin doing some php only when microsoft
      > will have released Visual MSPHP. Thats it.

      I can't decide if that's tongue in cheek or if you're really that much of a troll.

      --
      StoneCypher is Full of BS
  27. WORKING LINK (for now) by Thoguth · · Score: 3, Informative

    http://talks.php.net/show/php5intro

    Not trying to karma-whore, I just thought I'd use my +1 for something good because nobody seemed to notice the AC link.

    --
    The requested URL /iframe/sig.html was not found on this server.
    1. Re:WORKING LINK (for now) by Anonymous Coward · · Score: 0

      I like the namespace examples (php parsing errors).

      If it doesn't work - why use it in a presentation?

  28. Page Mirroring by SudoPenguin · · Score: 0, Offtopic

    This slashdotting is getting a little out of hand. Why doesn't slashdot actually start making articles out of these news items instead of links to other sites where no one can read the news.

    1. Re:Page Mirroring by Anonymous Coward · · Score: 0

      umm..

      because that would be too much like working for subscription and ad revenue.

  29. Re:Apache is Dying! Let's look at this months numb by winkydink · · Score: 2, Insightful

    Can you say "statistically insignificant"?

    --

    "I'd rather be a lightning rod than a seismometer." -Ken Kesey

  30. 500 Internal Server Error by Lxy · · Score: 1

    Did Slashdot just attempt an upgrade to PHP 5?

    --

    There is no reasonable defense against an idiot with an agenda
    :wq
    1. Re:500 Internal Server Error by Anonymous Coward · · Score: 0

      /.'s been weird all of the past 3 hours... I just got several errors telling me I've posted -221 seconds ago, and to chill!

  31. PHP5 strikes back by Anonymous Coward · · Score: 0

    Internal Server Error
    Apache/1.3.26 Server at slashdot.org Port 80

  32. PHP5 wishlist by Kunta+Kinte · · Score: 2, Interesting

    1 - Better variable scoping features. I'd like to be able to say something like...

    session
    {
    $SessionVar1 = 1;
    $SessionVar2 = y;
    }
    where 'session' is a keyword that executes a block of code or variable declarations in session scope, and have those variables persist throughout the session. Same for application scope, that is variables in that scope persist for the entire life of the PHP engine, and available in all scripts. ( was that the ACLs they were refering to? in the story summary? )

    2 - Built in Opcode caching.

    3 - More consistant library function naming.

    4 - Support for 'taglibs'. The same functionality can be done using functions, well sort of. But this is very usefull when separating the work between web programmers and non-technical designers/maintainers.

    That's my list...

    But yeah, you're right, I should shut-up and code them or stop complaining.

    --
    Based on upvotes, Ageism is the only "-ism" Slashdotters care about and think isn't SJW
    1. Re:PHP5 wishlist by TheTomcat · · Score: 1

      One at a time:

      1 - Better variable scoping features. I'd like to be able to say something like...

      session
      {
      $SessionVar1 = 1;
      $SessionVar2 = y;
      }

      where 'session' is a keyword that executes a block of code or variable declarations in session scope, and have those variables persist throughout the session. Same for application scope, that is variables in that scope persist for the entire life of the PHP engine, and available in all scripts. ( was that the ACLs they were refering to? in the story summary? )


      How about:
      $_SESSION = array(
      'SessionVar1' => 1,
      'SessionVar2' => 'y'
      );

      As for application variables, Derick Rethans' SRM (Script Running Machine) allows this. PHP is a language, not an application server (like IIS/ASP or ColdFusion).

      ACLs are for "shared" objects -> they aren't fully public anymore.

      2 - Built in Opcode caching [turcksoft.com].
      Won't happen. This is a Zend Engine function and Zend sells a package that does this. The source is available, however if you want to implement your own cache (or use another like APC).

      3 - More consistant library function naming.
      I agree with this. There are other inconsistency issues, but it's impossible to fix these without breaking backwards compatibility. Namespaces (PHP5) will help this, greatly.

      4 - Support for 'taglibs'. The same functionality can be done using functions, well sort of. But this is very usefull when separating the work between web programmers and non-technical designers/maintainers.
      Again, PHP is a language, not a server. That said, check out the many templating engines. Especially Smarty (smarty.php.net). Andrei Zmievski wrote it, and it's pretty sweet.

      S

  33. PHP Is *not* an application server by tweakt · · Score: 5, Informative

    In PHP, all you have are scripts. Sure they may be optimized, compiled, pseudo-object-oriented and even obfuscated... but they are still scripts. They may even include eachother. But they are still *SCRIPTS*.

    After executing, they forget all knowledge. There is no persistence, no threading, no transactional support. All attempts to improve efficiency are afterthoughts and hacks.

    At one point I tried to implement in-memory "application" wide shared data. The concept is, something may need to be loaded when the site is first loaded, and then it should be kept in RAM, and we need exactly ONE instance of it.

    I gave up... using shared memory was too tricky and isn't even platform independent. It's not part of the core language, and even if it worked, it would not turn PHP into an application. It still runs in a modular fashion.

    Now with a Java servlet, you have an application that is running. Within your servlet you may define some data exist indepently of web requests. Servicing a request is just one aspect of it. Its much more like a real program, which is why it're referred to as an Application Server.

    For very simple things, that don't need to scale, both in usage, and codebase, then PHP is ok. But for design real web applications, which need to be managed by more than a few developers, integrate with legacy systems, implement a full three tier architecure, etc, PHP just doesn't cut it.

    A lot of the bad sites which go down easily when /.'d are simply bad coding. Making 16 database accesses per page is not bad when just a few people visit at once, but when the stampede comes, your toast. Most people don't develop with that in mind.

    Java has some serious strengths in the Web department, it's proven technology, and is not very complicated at all. It's just that most people aren't used to writing structured code. JAva forces you to follow somewhat good practices and the extra work pays off in maintainability. PHP and Perl you can just hack away, without any strong typing, etc and get something done very quickly but in the end it will become a mess quite fast.

    I'm not saying Java will solve your problems, but there is a strong base of best practices, design patterns and example code to help you keep your code in nice shape.

    With PHP, it seems like everyone has their own code libraries, utility scripts, ways of coding, etc and its really tough to resuse someone elses code. Java Interfaces and Inheritence comes in very handy.

    Ok... enough ranting. Anyway, I used to be a hardcore PHP supported because you could whip together things very easy, but as I learned more java and needed to do larger projects and learned more about efficient coding, I realized with PHP you will eventually just run into a wall and that's when it's time to look for better solutions.

    1. Re:PHP Is *not* an application server by ethank · · Score: 1

      Well, you outlined the exact reasons I'm moving my code from PHP to Java.

    2. Re:PHP Is *not* an application server by Kunta+Kinte · · Score: 1

      You're absolutely right. PHP's not an application server.

      The problem is that's what many, many, people need when they decide to use PHP. That's not PHP's fault, but I believe it's such a big problem that maybe steps should be taken to address this. Either via application server features in PHP engine for through education.

      Maybe in the future this would prevent people from writting CMS applications in PHP.

      --
      Based on upvotes, Ageism is the only "-ism" Slashdotters care about and think isn't SJW
    3. Re:PHP Is *not* an application server by bahwi · · Score: 3, Interesting

      Best reason not to move to Java: click.

      Programmers determine coding practices, structure, etc. You can find obfuscated java code, obfuscated python, obfuscated perl, or obfuscated php. It all depends on the _programmer_, not the programming language. It's like blaming car accidents on the type of car a person drives.

      Structured code is a good thing though, and so is efficiency.

      Most PHP Projects are put on a shared server, so using shared memory will generally anger the host. For enterprise level, maybe for a simple simple form I'd go with PHP, everything else I would go with something more hardcore, and yes, even Java. Java is a good language, but it's bad to be trapped to a single company for your language.

      Mod_Perl on Apache does shared memory, along with several other improvements. With strict coding practices in a company, and someone going over the code(should be done with _every_ language and _every_ project) the code is easy to read, easy to re-use, and easy to modify. Yes, even Perl. High level enough to do things quickly and easily, and powerful enough to do it very quickly, using shared memory, etc.. Don't underestimate the power of mod_perl, it's easy to get a dynamic database page with mod_perl to load faster than static content.

      And with mod_perl, and good practices(again, necessary even in Java) it will scale easily to multiple servers, legacy systems, etc...

      Of course, we're waiting on Parrot. Yeah, kinda Perl 6, but yeah, it will compile Java. And yeah, cross platform, unlike Java (Java on BSD is a PITA, _and_ reminds me of Win 3.1 on my 33mhz system back in the day).

      So again, the problem is the programmer, not the language. Although you are correct that PHP is not an application server. But look at Parrot and look at Perl, things can grow into even better things.

      Parrot also has a BF (Brain****) interpreter.

    4. Re:PHP Is *not* an application server by the+eric+conspiracy · · Score: 2, Insightful

      Best reason not to move to Java.... Java is a good language, but it's bad to be trapped to a single company for your language.


      The same could be said for Visual Basic, .Net, etc.

      You don't really think that IBM would let Java die if Sun ran into real financial trouble, do you?

      The fact is that there are so many large organizations tied to Java the likelihood of it dying out is the same as Cobol i.e. zero.

    5. Re:PHP Is *not* an application server by Anonymous Coward · · Score: 0

      Congratulations. You just discovered that each project requires a different solution.

      Now for the sake of it, why don't you try to build a web application with assembly?

    6. Re:PHP Is *not* an application server by Ratso+Baggins · · Score: 1
      but if you have a database you could employ a technique for clustering sessions via a database no? so as usual 'best practices' depends on knowing what you are doing...

      UPDATE application_variables SET value='bulshit' WHERE id=1

      --

      --
      "we live in a post-ideological world..." - Billy Bragg.

    7. Re:PHP Is *not* an application server by tshak · · Score: 1

      Looking at a Sun's stock as a metric in which to measure Java's future is folly at best. Java's not going anywhere. I'd be more worried about PHP falling into a niche and "barely supported" category (even though that's not likely either). I agree with the parent post - scripts should not be used for Web Applications, because Web Applications need a full blown application server. I personally prefer ASP.NET, but I'd much rather come into a company with a Web Application written on a J2EE platform then one scripted in PHP, Perl, etc.

      --

      There is no longer anything that can be done with computers that is nontrivial and clearly legal. -- Paul Phillips
    8. Re:PHP Is *not* an application server by Anonymous Coward · · Score: 0

      So how would you recommend having a page run that needs 16 database accesses per page?

      That doesn't seem that illogical to me. I need different information in different parts of my page, so I run 16 queries over a connection to a DB. How could I possibly get around that?

      The only thing I can think of would be to have some type of thing remember some of that information, like a cache or something, but typically that information is not static so.... And if it is static, there is Smarty templates to only refresh every so often the information. This prevents even the .php file from being processed.

      So yah. I guess my question is how can I get around 16 DB access per page using java? Or am I missing something huge in Java?

    9. Re:PHP Is *not* an application server by Anonymous Coward · · Score: 0

      results caching via persistence layers.

      SQL is for chumps.

    10. Re:PHP Is *not* an application server by Dalroth · · Score: 4, Insightful

      I was going to provide a quick and simple response. Then I decided to not get involved. Then I reread your post and couldn't help myself.

      I'm going start out by getting to the point: Java is not the answer to everything. Not everything should be judged using Java as the standard. And finally, PHP is good enough for yahoo? Seems so: http://news.com.com/2100-1023-963937.html?tag=lh

      In the interest of full disclosure: I am a full time senior level architect/programmer for one of the largest mortgage companies in the country. Most of the work I do is C# with an XML+XSL frontend these days. I won't touch any Microsoft product for my own personal projects, so in my spare time I do a lot of C++, Ruby, Perl and PHP work. I've long since given up dealing with Java, although there are Java projects (such as Struts, Cocoon, and JBoss) that I deeply respect.

      I don't even like PHP, but it gets the job done. It gets it done far quicker and far easier than Java and most other languages, and I've long since learned that worse is often better (ask the Lisp community if you don't know what that phrase means).

      To start, I want to point a major flaw in your arguments: Most of these PHP sites are written by amateurs plain and simple. Even a lot of the bigger PHP projects on freshmeat are clearly created by people who do not have a wealth of knowlege, but in it's place have a lot of dedication. That's fine. In fact, that's the way it should be.

      The web was built via the back breaking work of millions of amateurs around the world. These people have just as much right to participate in this medium as us professionals do. Without them the web would be a desolate wasteland of holier than thou illuminati. Instead it's a rich and beautiful medium of communication supported by everybody.

      "I gave up... using shared memory was too tricky and isn't even platform independent. It's not part of the core language, and even if it worked, it would not turn PHP into an application. It still runs in a modular fashion."

      Why aren't you using the session? PHP has supported sessions for sometime now. There's no reason for you to be touching shared memory in a language like PHP. Would you do the same in a JSP page? I think not... Maybe you have your reasons, and PHP session handling is certainly not perfect in all situations, but your lack of an explanation as to what you are doing leads me to believe you either did not explore all possibilities, or you are making judgements based on older versions of PHP that are simply not valid anymore.

      For very simple things, that don't need to scale, both in usage, and codebase, then PHP is ok. But for design real web applications, which need to be managed by more than a few developers, integrate with legacy systems, implement a full three tier architecure, etc, PHP just doesn't cut it.

      Please excuse my english: 3-tier architectures are overrated overrused bullshit. Everybody has a different meaning for them, everybody has a different use for them. The only successfull n-tier architectures I have seen (and this comes from years of distributed COM+ development experience) are those that follow this structure:

      Client -> Provider -> Scarce Resource

      Where client is typically the web browser, the Provider is typically your web server, and the Scarce Resource is typically your database.

      Breaking that into more tiers is imho absolutely foolish. The extra code complexity introduced, the marshalling overhead, latency overhead, thread synchronization issues, deployment issues, and security considerations are simply NOT WORTH IT! Why? Because the ONLY thing that really matters in the long run are your scarce resources!! That's your database! If you minimize calls to your scarce resources, you will get MUCH better bang for your buck than through any other medium. You can always throw some smart caching in there somewhere, but caching is NOT the same as adding an extra

    11. Re:PHP Is *not* an application server by Synn · · Score: 4, Interesting

      The "a scripting isn't a REAL programming language" arguement is as tired as it is old.

      I started with Java back when the only IDE out was Symantec's Cafe(not Visual Cafe) and frankly over the years I've found myself to be most productive using scripting languages like perl and php.

      They get things done faster with less code needed to be written in a world where fewer lines of code typically translates into fewer bugs and more productivity per programmer. And I can code in any amount of structure into a project as I see fit.

      Now if I worked in a huge corporation where any idiot could submit code into my project, then yes a language that forces your hand could very well be a good thing.

      But in skilled hands things like strong typing and forced OO really only get in the way.

    12. Re:PHP Is *not* an application server by Dalroth · · Score: 1

      Ok, I got a little worked up. I don't mean to attack anybody on a personal level(and definitely not the poster of the original message).

      I'm just sick of hearing that "so and so" language is no good and "so and so" (which unfortunately happens to usually be Java) is better. It's not true, and it just happens so often that it finally caused me to boil over.

      To reiterate, the only language correct language is the language that allows you to get your work done and have fun while you are doing it. Nothing else matters in the long run.

      Bryan

    13. Re:PHP Is *not* an application server by horace · · Score: 1

      Well maybe not but what is an application server? An excuse for not thinking very deeply about the nature of the project and for preventing people doing introducing nasty changes.

      How many java architectures are monolithic monstrosities where changing the smallest part of a page requires a day's work and the whole site needs to be brought down to release it.

      I'm sure that there is stuff that PHP can't do but it isn't the only place that is braindead. Too many websites are being run like 70s mainframe shops which is all very well but isn't how the web got built.

    14. Re:PHP Is *not* an application server by Anonymous Coward · · Score: 0

      ``At one point I tried to implement in-memory "application" wide shared data.''

      I've been head system architect for about three dozen large PHP-based systems and four mid-sized JSP projects. Unless your data is strange (like you need to store 500+ Mbytes or it's something that doesn't map well into a relational DB), you don't store shared data in PHP or even in C, because you can keep it in an SQL server. The PHP/MySQL combo is so fast that you can just store it in the database. It's easier to maintain there anyway since your programmers, almost all the (semi)technical people, and many of the managers and employees understand SQL. I understand that not all data can be fit into a db like that, but other than one 400 Mbyte in memory hashed db (which we implemented in C) everything I've seen so far fit well into an SQL server and was still be able to handle 1+ million hits per day on a modest server. The days of storing large amounts of data in programming language-specific structures is long past. Keeping data in SQL is so much easier to develop and maintain. Also, have you tried debugging much code that uses shared memory? It's much more difficult.

      > [shared memory in PHP] isn't even platform independent

      It's standard Sys V shared memory. I don't think anything is more standard than that! We ported about 12,000 lines of 13 year-old C code to PHP in about three days. As far as I know, none of the shared memory specfic stuff (like shm_attach()) had to be changed. I think we even had some of the old C programs interoperating with the shared memory while we were developing (err, trying to figure-out what the heck some of the old programs did).

      > we need exactly ONE instance of it.

      The SQL DB is exactly one instance of it. It's also persistant and easy to maintain.

      Maybe I'm just old and tired of programming, but when people start talking about "shared data" in web systems, they usually are off-base. Data like prices, inventory, customer info, etc. does not need to be stored in a single block of memory that each process accesses. That's a problem that SQL databases solve very well.

      If someone disagrees with the "just wedge it into an SQL database," then I'd be happy to listen you. I can't imagine going back to the days of linked lists, trees, and other complicated programming structures to work with data. For example, "SELECT cust_id FROM cust WHERE state='CA'" is so easy.

    15. Re:PHP Is *not* an application server by supaflah · · Score: 1
      --
      --- Nothing but Blood and Kosmos
    16. Re:PHP Is *not* an application server by Anonymous Coward · · Score: 0

      I don't understand the reason for your linking to SUN's stock ticker page and the conclusion to not use Java... care to elaborate a bit?

    17. Re:PHP Is *not* an application server by Lordrashmi · · Score: 1

      I haven't used this and I won't use it since management decided ALL developement will be in Java but this project looks interesting. It is called SRM and basically it is a daemon that runs and keeps objects in memory.

    18. Re:PHP Is *not* an application server by lux55 · · Score: 1

      I think there is still a use for application-level variables (like ASP and Cold Fusion have) or the Java "application server" method, not for storing data you care about, but for lowering the overhead of instantiating objects you reuse each page request. For example, a global template object could be kept around between requests, since it's something you'll need again and again. Then again, PHPA and APC Cache, caching compiled, partial, or even complete templates, and other techniques can make the object persistence a negligible performance difference.

      I can see where application-level variables -- the only thing I can see missing from qualifying PHP as an "application server" according to the Java folks -- could have a place. It's one solution to a problem. But there's more than one way to solve most problems, and in this case Java's way is definitely not the only good one.

    19. Re:PHP Is *not* an application server by GnomeKing · · Score: 1

      There's no reason for you to be touching shared memory in a language like PHP.

      I think there is...

      I run a site which attracted up to 30 hits a minute at its peak. This particular site did a lot of calculations - it was performing a simulation for an online game.
      Without shared memory, each calculation was taking several seconds...
      Obviously with several seconds per simulation and one simualtion every 2 seconds (all roughly) the site died horribly...
      using shared memory with some useful precalculated matricies was the only method I found (short of throwing more hardware at it) that was able to keep up with the demand...
      it actually reducing the time per simulation to about 0.2 seconds

      so I'd say that shared memory does have its uses

    20. Re:PHP Is *not* an application server by LPetrazickis · · Score: 2, Funny

      It's like blaming car accidents on the type of car a person drives.

      Sounds fair. You get the Pinto.

      --
      Is this a sigs-optional kind of place? 'Cause I am totally down with that if you know what I mean.
    21. Re:PHP Is *not* an application server by rollingcalf · · Score: 2, Insightful

      If Sun dies, Java will still live on. Unlike the completely closed up languages like Visual Basic, Java has a specification that has been used by other companies to create compilers and virtual machines. It is not dependent on any particular company for its ongoing survival, just as C++ and COBOL are not dependent on any company.

      --
      ---------
      There is inferior bacteria on the interior of your posterior.
    22. Re:PHP Is *not* an application server by rnd() · · Score: 1

      Interesting comment... can you talk a bit more about why you don't use C# and asp.net for your personal projects? I'm curious about your thoughts on this subject and on your thoughts about C# and asp.net in general and in comparison to php.

      --

      Amazing magic tricks

  34. Re:Apache is Dying! Let's look at this months numb by Lxy · · Score: 1

    A drop in share in one month doesn't conclude to the OS dying. However, you bring up an interetsing point. When Apache loses ground, it never gets posted to Slashdot. When Apache gains, no matter how slight, it does get posted.

    I'm all for the promotion of open source, and certainly Apache is a kickass product.

    --

    There is no reasonable defense against an idiot with an agenda
    :wq
  35. Not so odd as you would think by SuperKendall · · Score: 1

    I was at a talk on JBoss, and they were saying there a "killer App" would be a PHP interpreter to run PHP inside JBoss so you could get things like real transaction and failover support...

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
  36. Java??? by BurKaZoiD · · Score: 0, Flamebait

    Java by any other name...

    What's this Java you speak of? Oh! Yes, I think I will have a cup; two sugars, no milk, please.

  37. DON'T CLICK ON THE PARENT!!! by shadwwulf · · Score: 1

    The parent of this comment is a redirect to goatse.cx.

    Just a word of warning! 8')

    1. Re:DON'T CLICK ON THE PARENT!!! by grub · · Score: 1


      The parent of this comment is a redirect to goatse.cx.

      Maybe some of us like going to goatse.cx.

      --
      Trolling is a art,
    2. Re:DON'T CLICK ON THE PARENT!!! by Anonymous Coward · · Score: 0

      Of course you all do, you're sick homosexual pedophiles. You did say you use Linux, right?

    3. Re:DON'T CLICK ON THE PARENT!!! by death+or+glory · · Score: 1

      pussy

  38. Re:Java? Hardly. by stonecypher · · Score: 2, Insightful

    > Leave it to a Perl guy to compare PHP to Java.

    Leave it to a Java guy to make asinine comments about practitioners of another langauge. Leave it to a C++ programmer (me) to compound the error.

    > Of course, Perl has had all this for some time.

    Yah, so have lots of languages. That makes it entering PHP no less exciting.

    > Either way, PHP makes for a good interface
    > language for web apps - I guess. You can throw
    > it on top of an application layer to do the
    > real work.

    My, how casually dismissive. PHP scales far better than Perl does. Go talk to the yahoos at Yahoo!. (There are good arguments raging about PHP vs. Java in scalability, and so I won't start that here, as I don't want a bad argument to be my fault. Go read if you want to, but don't just assume that because you can't write scalable PHP it can't be done.)

    --
    StoneCypher is Full of BS
  39. Re:PHP Sucks by bellings · · Score: 1

    I that PHP might possibly be the only web scripting toolbox on earth worse than ASP, and it gets marked as flamebait. I suppose it deserves it -- ASP is amazingly ugly. Comparing anything to ASP is pretty damned hostile.

    But, lets be frank here. PHP really amazingly shitty.

    --
    Slashdot is jumping the shark. I'm just driving the boat.
  40. PHP by www!!!1 · · Score: 2, Funny

    PHP? What's that? If you can't write it in pure assembly, its not worth writing!

    1. Re:PHP by Anonymous Coward · · Score: 0

      If you can't be bothered to memorize the instructing encoding and write in a hex-editor, then don't even speak to me beacause your just a MS Weniee.

  41. Re:Java? Hardly. by Anonymous Coward · · Score: 0

    >> Just curious, how can you have an object model without namespaces?

    My understanding is this is more of a syntax thing - PHP4 effectively has namespaces in that you can place functions in a class (namespace) so that's 1 level deep. With PHP5 you can nest classes within a namespace block so you've got a further "layer" where outside of which names won't conflict. Believe their also introducing nested classes, which amount to the same thing.

    The interfaces thing is a step towards Java (along with abstract classes). With PHP4 you have inheritance (extends keyword) and you can use it as you will.

    Course the presentation is asking to be flamed by Perl coders after some unnecessary anti Perl remarks...

  42. Are you kidding me?? by miketang16 · · Score: 1

    Great... now I have to upgrade all my servers... Weeee! Oh well, maybe the have some new session stuff.

    --
    -------
    "In times of universal deceit, telling the truth becomes a revolutionary act."
    -- George Orwell
    1. Re:Are you kidding me?? by Anonymous Coward · · Score: 0

      Oooh, wow, Mr. Mike Tang, aged 16 has spoken! He is so 1337 that he has *servers*! I bet he runs Leenucks on them, 0wnZin' me all the way back to 10th grade! Hear, hear!

    2. Re:Are you kidding me?? by miketang16 · · Score: 1

      If you really are concerned, my last name is Tangolics actually, and I'm a Junior not a Sophomore. Furthermore, I find it quite ironic that you are criticizing me with childish remarks about '1337'ness and '0wnZin'. I may be younger than you, but it does not mean I am automatically immature and a 'script kiddy', so the next time you try to insult someone, make sure you know more about them than just what you can extrapolate from their screen names.

      --
      -------
      "In times of universal deceit, telling the truth becomes a revolutionary act."
      -- George Orwell
  43. Re:Java? Hardly. by Osty · · Score: 1

    I'm still trying to figure out why I had to pay extra for floor mats.

    I'm guessing you bought either a German car or an Italian car ...

  44. run PHP as a CGI by DrSkwid · · Score: 1

    run PHP as a CGI and not an Apache Module and all your security fears melt away in the night

    --
    There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
    1. Re:run PHP as a CGI by pacman+on+prozac · · Score: 1

      Especially after you upgrade to PHP 4.3.1 which was released with a fix for a serious CGI vulnerability :)

      advisory from php.net

    2. Re:run PHP as a CGI by tunah · · Score: 1

      You mean security fears like the big hole in 4.3.0 that only affected CGI users?

      --
      Free Java games for your phone: Tontie, Sokoban
  45. While we are adding features... by xiaix · · Score: 1
    Can we PLEASE make mcrypt built-in to the standard install?!?!? I'm tired of having to compile (and re-compile.)

    C'mon if it can be done with GD, and the curl library, surely mcrypt is worth adding.

    --

    Have you read the Moderator Guidelines yet?

    1. Re:While we are adding features... by BitHive · · Score: 1

      Yeah, and Sablotron!

  46. Re:Java? Hardly. by Anonymous Coward · · Score: 0

    PHP does scale far better than plain Perl for cgi. But it comes nowhere near Perl when you are using mod_perl, I think our own /. is an attest to that.

  47. Why PHP? by Anonymous Coward · · Score: 0

    Why don't you use a real application server for your persistent objects?

    Wasn't it kind of difficult to reinvent the wheel?

    1. Re:Why PHP? by oGMo · · Score: 1

      Difficult, not really. I'd done similar things before, and although it took all the cute PHP hacks I knew to accomplish it, it wasn't really hard.

      As for the other, they wanted PHP, and it seemed fairly reasonable at the time.

      --

      Don't think of it as a flame---it's more like an argument that does 3d6 fire damage

    2. Re:Why PHP? by Anonymous Coward · · Score: 0

      nice sig

  48. Re:Java? Hardly. by stonecypher · · Score: 1

    > But it comes nowhere near Perl when you are
    > using mod_perl, I think our own /. is an attest
    > to that.

    You think incorrectly, sahib. Even using mod_perl, PHP scales far better. Nice try, though.

    The fact of the matter is that with enough attention, most languages scale acceptably. Slashdot runs on a pretty serious server set. I bet you could get a pretty good intercal server going if you tried hard enough.

    --
    StoneCypher is Full of BS
  49. Re:Java? Hardly. by 8282now · · Score: 1

    ... don't you mean "dons"
    /me dawns the inane spell checker suit

  50. Re:is PHP5 ZOPE? by smack_attack · · Score: 1

    Zope = Huge bloated Python CMS
    Midgard = Huge bloated PHP CMS

  51. Re:PHP Sucks by Anonymous Coward · · Score: 0

    Yeah! Sounds like you're still sore about PHP being the first open source technology to come from behind and whoop the incumbent MS equivalent: http://newsforge.com/article.pl?sid=02/06/11/01124 3&mode=thread&tid=5

  52. Re:PHP Sucks by AllMightyPaul · · Score: 1
    It's obvious that you've never actually used PHP. Let's analyze a few of your easily refutable claims. I'm not going to analyze all of them.
    • Ah, but with ASP you're locked into using a Microsoft server. With PHP you can use Microsoft, Apache, Zeus, and a handful of others. In theory you can use it on any platform and with any server. Granted, there are programs like ChiliSoft, but you do have to pay for that ($495 per server).
    • Which functions, procedures, methods and objects is it missing? I've had no problems finding what I need.
    • Response.Redirect() = Header("Location: http://somesite")
    • Server.MapPath() = $_SERVER["PATH_TRANSLATED"] or (__PATH__)
    • You can easily access all checkboxes using an array. Simply specify the name of each checkbox like this: NAME="value[]" and then you'll have an array of variables.
    • If PHP were so horrible, why is it the most popular module for Apache?
  53. only 5.0? by edrugtrader · · Score: 0, Offtopic

    MSN is up to 9.0 i think, i'll use them to make my new homepage.

    --
    MARIJUANA, SHROOMS, X: ONLINE?! - E
  54. Amen. by abulafia · · Score: 1

    mod_perl, postgres, apache and HTML::Mason rock.

    My company will develop in anything for cash, but it has been my experience that this combination is hands down the best general purpose web development setup. Rock solid, fast, extremely full featured, great rapid development, and generally fun to write.

    --
    I forget what 8 was for.
  55. Where is the unified database interfase ? by mxpengin · · Score: 2, Interesting

    What I would really love to see is a unified database API. It's horrible to have different APIs for each database.

    I know php has odbc support, but ... have you ever tried to make run odbc with mysql in a 100% unix enviroment ?

    Java has JDBC, perl has DBI, Microsoft has ODBC... I am waiting PHP can get something like that !

    --
    "We all know Linux is great...it does infinite loops in 5 seconds." -- Linus
    1. Re:Where is the unified database interfase ? by bob|hm · · Score: 1

      Try ADODB. Faster then PEAR and most (all?) other abstraction layers available.

      http://php.weblogs.com/ADODB/

      Benchmarks: http://phplens.com/lens/adodb/

      --Bob

    2. Re:Where is the unified database interfase ? by Anonymous Coward · · Score: 0

      You mean the PEAR::DB class?

    3. Re:Where is the unified database interfase ? by Christianfreak · · Score: 3, Interesting

      It does of course it still sucks, its not near as powerful as Perl's DBI but its a start and its much better than stupid_function_names()

    4. Re:Where is the unified database interfase ? by Monkey · · Score: 4, Funny

      Have you ever seen the IBM commercial where the engineer shows up to a board meeting and he's got this big ball of connnectors and dongles and shit all connected together? It goes something like this:

      CEO: What's that?
      Engineer: It's a universal adapter for everything.
      CEO: Everything?
      Engineer: Yes anything, we've built in support to connect to all possible interfaces.
      Executive Peon#1: Does it support European outlets?
      Engineer: Umm... <looks at device in dismay>

    5. Re:Where is the unified database interfase ? by ShotgunEd · · Score: 2, Informative

      I am waiting PHP can get something like that !
      It's called PEAR DB and it already exists... Although, admittedly, it's not nearly as slick as JDBC and not quite as powerful as DBI.

    6. Re:Where is the unified database interfase ? by CoolVibe · · Score: 1
      Java has JDBC, perl has DBI, Microsoft has ODBC... I am waiting PHP can get something like that !

      PHP has ODBC too.

    7. Re:Where is the unified database interfase ? by Dalroth · · Score: 1

      I'm using ADODB myself. It's a lot like ADO for (what else) Microsoft products. It's actually quite nice in my opinion!

      http://php.weblogs.com/ADODB

    8. Re:Where is the unified database interfase ? by Inda · · Score: 1

      Ah man you missed the punchline off :)

      Engineer: Umm... <looks at device in dismay>. You need an adapter.

      http://www.adage.com/news.cms?newsId=36527

      --
      This post contains benzene, nitrosamines, formaldehyde and hydrogen cyanide.
    9. Re:Where is the unified database interfase ? by millette · · Score: 1

      ...
      Executive Peon#2: Can you connect two adapters together?
      Engineer: Umm... Why would you need to do that?

  56. actually, if you read the article by jbellis · · Score: 2, Interesting

    (here's the pdf) ... many of the changes made bear a striking resemblance to the Java way of doing things Which is hardly a "flame," as one poster accused the article submitter; Java is (still) one of the cleanest language designs around, and gets a LOT of things right.

  57. Seems extremely sparse on details by Christianfreak · · Score: 1

    What I can get to anyway through the slashdotting.

    I managed to get to the namespace page, which I feel is one of the biggest problems, and it says nothing about namespace issues other than 'fixing the object model' and changing OP codes so you can add your own (what do OP codes have to do with it?).

    And what does fixing the object model mean? Are they going to create a standard set of classes and move the core functions into them (one can only hope) or are they going to stick with the every_function_in_my_namespace model that drive competent programmers nuts! /rant

    I would also love to see them embed regular expressions in the same way perl does. Nothing makes me more annoyed than preg_match() and preg_replace().

    1. Re:Seems extremely sparse on details by krumms · · Score: 1

      I would also love to see them embed regular expressions in the same way perl does. Nothing makes me more annoyed than preg_match() and preg_replace().

      Dear god no! We want to be able to read the code when we're finished writing it :P

  58. Re:STILL NOT AS GOOD AS PERL by sporty · · Score: 1

    Eh? 1 == 100%. And if you are using version numbers, 5 + 100% of 5 is 10.

    You prolly mean 20% better. 5 + 20% of 5 = 6 :)

    --

    -
    ping -f 255.255.255.255 # if only

  59. Re:Java? Hardly. by Christianfreak · · Score: 1

    I'll second your post and take the flames with you:

    LONG LIVE PERL!!!

  60. Why PHP dev are probably wrong... by MrNop · · Score: 0

    PHP is more and more oriented toward expert coders, giving them more and more OO stuff. That trend is, i think, terribly wrong. Php didnt get its success from expert coders, but from novices one, not knowing ANYTHING about oo. There is ton of stuff to do, and really more interesting stuff. For example : a true translation system to develop multi-language sites, an abstraction layer for SQL (no not a 50k external .php you have to include), to make all functions working on all OS (for example flock() dont work on Windows, even if its not so much work to reimplement it on this system) and so on. So there is ton of features that could make PHP a true killer, so why working on expert-only stuff ? - MrNop

  61. Assembly... pshaw. by bheerssen · · Score: 1

    To that I say:
    01001001011001100010000001101001011101000110 000001 11001100100000011011100110111101110100001000000110 10010110111000100000011011010110000101100011011010 00011010010110111001100101001000000110001101101111 01100100011001010010110000100000011010010111010001 10000001110011001000000110111001101111011101000010 00000111000001110010011011110110011101110010011000 01011011010110110101101001011011100110011100101110 001000000101100101100101011000010110100000101110

    --
    (Score: -1, Stupid)
  62. Re:Apache is Dying! Let's look at this months numb by abirdman · · Score: 1

    A minor quibble with an otherwise wise post:

    >> A drop in share in one month doesn't conclude to the OS dying

    Apache is an application, not an OS. Apache runs on quite a few OS's, and runs on Win32, as a matter of fact.

    --
    Everything I've ever learned the hard way was based on a statistically invalid sample.
  63. Re:is PHP5 ZOPE? by Anonymous Coward · · Score: 0

    PHP is a language. ZOPE is an application (mainly written in Python).

    Try eZ publish: http://developer.ez.no for a PHP based alternative to ZOPE

  64. Like to back that up? by abulafia · · Score: 1
    You think incorrectly, sahib. Even using mod_perl, PHP scales far better.

    This isn't my experience at all.
    I've scaled mod_perl to several million pageviews/day levels of traffic - it always behaves predictibly and sanely.
    We run php internally, becuase some of the software we use in house is written in it, and all those tools are dog slow.
    I don't like php very much, so I don't use it, so I can't compare myself.
    Can you point to any real comparisons?
    I know Yahoo decided they liked it, but I've never seen real comparisons.

    --
    I forget what 8 was for.
    1. Re:Like to back that up? by mgkimsal2 · · Score: 1

      How many machines and what kind of hardware did you run millions of pageviews per day with mod_perl on?

    2. Re:Like to back that up? by abulafia · · Score: 1

      My rule of thumb was one box per ~140 hits/second. For that site's page weight and activity, it worked out out to an average of 1 box per (very roughly) 1.5M pageviews, averaged (eg, spikes are not accounted for here). These were pretty heavyweight pages, though; a fair amount of DB activity, images and dynamic content. Lighter pages or less dynamic content and you can do better.

      On that site, for the main web cluster, there were 6 low end Sparcs doing web service. Five were fine; the extra was for failover and rotating in software updates.

      Our average daily traffic was around 30M hits (not PVs); peak traffic ran around ~750 hits/sec.

      I'm curious where an example of a site doing that level of traffic with PHP is, and what they're using. As I said, I intentionally don't have much php experience, because I don't like the language.

      --
      I forget what 8 was for.
    3. Re:Like to back that up? by mgkimsal2 · · Score: 1

      Neopets.com

      There's a write up in linuxjournal about it from a couple years ago. Whether they've got the same traffic or not now I don't know.

      http://www.linuxjournal.com/article.php?sid=4488

      "The company secured the services of Web Zone Inc. of Santa Clara, California and Broomfield, Colorado-based Level 3, a multinational Tier One provider with hosting facilities in Los Angeles. This provided enough bandwidth to deal comfortably with anticipated traffic volumes. NeoPets then added yet more staff and purchased about 50 Red Hat/Apache web and image servers, two more MySQL Servers and a Sun server to run an Oracle database. Once the Oracle conversion was completed, page views soared to over 40 million a day. "

      The '50' servers could probably be reduced to half that now, considering hardware capacity and prices. that's 40M page views, not hits. It's graphic intensive, so I'd figure many times as many hits as page views per day.

    4. Re:Like to back that up? by Dirtside · · Score: 1

      I work for Neopets. We range between 180 million and 260 million page views a day, on around a hundred Red Hat web servers. All our pages are PHP. However, the pages are all very database-intensive (anywhere from 3-10 Oracle DB queries per page, plus occasional MySQL stuff), and we send a shitload of image data as well. The other thing is that our site usage flows very much in parallel with "prime-time" usage; basically when the first U.S. kids get out of school (~3pm EST) to when the last U.S. kids go to bed (~10pm PST, about a 10-hour window) we have around four times the number of page views and bandwidth usage per second that we do during off-peak. Our servers are underutilized at night and slammed during the day. Our daily outgoing bandwidth averages around 600 Mbps (about 6.5 terabytes daily).

      We don't code in a particularly well-structured way, so I'm sure there's a lot more efficiency that could be gained, but everything seems to work rather well.

      --
      "Destroy science and religion. Science would re-emerge exactly the same; but not religion." - Penn Jillette, paraphrased
    5. Re:Like to back that up? by mgkimsal2 · · Score: 1

      What size are the servers? Single/dual proc? Any other info you can share would be appreciated. Thanks for the info you've shared so far. Anyone who says PHP can't scale can't really argue with those numbers.

    6. Re:Like to back that up? by Dirtside · · Score: 1

      Mostly (as I recall) dual P3-900s or thereabouts, on 1 GB of RAM per box. I don't know what "size" they are; I'm guessing you mean rack space size. About four inches high? :) I haven't been to the cage in well over a year, I don't really know... besides, I'm a PHP games programmer for the site, not a sysadmin. (Thank god! ;))

      --
      "Destroy science and religion. Science would re-emerge exactly the same; but not religion." - Penn Jillette, paraphrased
  65. Re:Apache is Dying! Let's look at this months numb by Anonymous Coward · · Score: 0

    No! Apache is an OS as in operating system and it is dying. What is your problem? Why do you have to confuse people? jerk.

  66. Re:Java? Hardly. by Christianfreak · · Score: 1

    My, how casually dismissive. PHP scales far better than Perl does. Go talk to the yahoos at Yahoo!

    I personally don't care what the yahoos at Yahoo! think until they show me some benchmarks.

    More accuratly their programming staff probably complained that "Perl is too hard" (I hear it from PHP developers all the time). Besides if I understand correctly Yahoo was using CGI (which may have been perl but could have been C or something else)

    Scalability depends on a lot more than just the language, it (obviously) depends on hardware and then on how well the app is written. Perl and PHP both will slow a site to a grind if there is inefficient code. (same goes for security to all the people who blab on and on about PHP being inherently more secure)

    Finally show me a benchmark! I've only ever seen one un-biased benchmark on this subject (and I can't find it now) and it shows Perl and PHP's scalability to be relatively the same.

  67. PostgreSQL hosting by Anonymous Coward · · Score: 0

    Depends on your needs. If you are looking for business class hosting, Command Prompt does well. They have private instance databases instead of shared instance like most other providers.

  68. Separation of code and content by Malc · · Score: 1

    Is there any talk of separation of code and content? Love 'em, or hate 'em, MSFT has done this with ASP.NET. It seems like a logical progression to the current model, where the content is independent of the code in the implementation behind it. PHP.Net would be very cool, and a nice alternative to C# or VBScript.

    1. Re:Separation of code and content by Anonymous Coward · · Score: 0

      With any template engine (for php you have so many of them) you can separate code from content. It's not invented by MS.

    2. Re:Separation of code and content by Malc · · Score: 1

      Err, I don't think you understand how ASP.NET does it, or what I meant. I guess the point is rather irrelevant as PHP isn't language neutral like ASP

  69. the unified database interface is already in PEAR by ubiquitin · · Score: 1
    --
    http://tinyurl.com/4ny52
  70. How do you disable weak SSLv3 & TSLv1 ciphers by Anonymous Coward · · Score: 0

    How do you disable weak SSLv3 & TSLv1 ciphers on a IIS 5.0 server?

  71. PHP? Hardly. by althalus · · Score: 1

    Uhh, yeah, read into their tests. Even after pulling old Rasmus into yahoo, Mod_perl *still* outperformed PHP, even by just at little after all that.

    They chose PHP over mod_perl, because it was easier to hire cheap monkeys to bang away on the php pages. They didnt' want all the flexibility mod_perl offered, they needed to give a simple toolkit to bust out pages within their criteria. PHP was the best minimized solution for their needs.
    It wasn't the fastest, it wasnt' the most full-featured.

    1. Re:PHP? Hardly. by Anonymous Coward · · Score: 0
      1. The tests were done long before Rasmus was working for Yahoo. He wasn't involved. The PHP side was set up by folks who literally had only a couple weeks of PHP experience.
      2. PERL is used all over Yahoo, and has been from the beginning. Its biggest problem isn't performance, it's maintainability. (In a production environment, unnecessary "flexibility" can be a liability. If you disagree, spend a decade in the business and tell me if you still feel the same way.)
      3. Yahoo has no problem finding PERL programmers. But not everyone who looks at a script is a programmer. Readability and consistency can be important when a producer or editor might have to tweak things. That's not to say that PERL can't be equally readable and consistent, but even the PERL guys admitted that it was less likely to stay that way.
      4. "Good enough" performance is just that. People are more expensive than servers. At the end of the day, the choice of PHP was a business decision, based on the entire lifecycle of Yahoo's content.
  72. Re:PHP Sucks by Christianfreak · · Score: 1

    If PHP were so horrible, why is it the most popular module for Apache?

    Because all those web "programmers" out there can't be bothered with some of the strictness of mod_perl?

  73. php compiler to byte code by eenglish_ca · · Score: 1

    The next step is to make a program for compiling php to byte code so it will be java.

    --
    Checking out my form of escapism.
    1. Re:php compiler to byte code by mgkimsal2 · · Score: 1

      Do you mean to translate it to Java byte code? Or 'byte code' in general so it would be 'like' java? There are already a few products which both obfuscate and compile your code so you can redistribute it to other PHP servers without the source code. zend.com and ioncube.com both do this.

  74. Re:PHP Sucks by bellings · · Score: 1
    The missing functions are these:
    1. No paramatarized queries in the standard MySQL database module
    2. No equivilant to Server.MapPath (read the documentation -- $_SERVER["PATH_TRANSLATED"] doesn't do the same thing)
    3. The NAME="var[]" thing is a fucking hilarious hack. Every time I read that part of the PHP manual I simply can't stop giggling
    4. No URL handling functions at all.
    5. since PHP includes no functions to translate relative URL's to absolute URL's, manually setting headers like your example is an incredible pain in the ass. How would you write the equivilant to <% Response.Redirect("foo.asp"); Response.End() %> in PHP? Remember, you have to send a fully-qualified URL in your response.
    PHP is a perfectly fine language if you have a smart, dedicated team writing the custom, application specific extensions in a real language, and simply use PHP as a glue between your HTML and the "real" code. But trying to actually write your "real" code in PHP is a recipe for a hideous, convoluted mess.

    PHP is simply not a good language for writing web-based applications. It's that simple.
    --
    Slashdot is jumping the shark. I'm just driving the boat.
  75. Use binary by Anonymous Coward · · Score: 0

    otherwise you will always have a bit of uneeded bloat and "possible" reference inefficiency.

  76. Re:System-wide objects by x-empt · · Score: 1

    System-wide objects are VERY easy to implement in PHP currently. Just use shared memory and sems....

    For more information please see: http://www.php.net/manual/en/ref.sem.php

    "This module provides wrappers for the System V IPC family of functions. It includes semaphores, shared memory and inter-process messaging (IPC).

    Semaphores may be used to provide exclusive access to resources on the current machine, or to limit the number of processes that may simultaneously use a resource.

    This module provides also shared memory functions using System V shared memory. Shared memory may be used to provide access to global variables. Different httpd-daemons and even other programs (such as Perl, C, ...) are able to access this data to provide a global data-exchange. Remember, that shared memory is NOT safe against simultaneous access. Use semaphores for synchronization. "


    Please note that: "No external libraries are needed to build this extension."

    --
    Ever need an online dictionary?
  77. Re:PHP5 wishlist - Session Variables by x-empt · · Score: 1

    System-wide objects are VERY easy to implement in PHP currently. Just use shared memory and sems....

    For more information please see: http://www.php.net/manual/en/ref.sem.php

    "This module provides wrappers for the System V IPC family of functions. It includes semaphores, shared memory and inter-process messaging (IPC).

    Semaphores may be used to provide exclusive access to resources on the current machine, or to limit the number of processes that may simultaneously use a resource.

    This module provides also shared memory functions using System V shared memory. Shared memory may be used to provide access to global variables. Different httpd-daemons and even other programs (such as Perl, C, ...) are able to access this data to provide a global data-exchange. Remember, that shared memory is NOT safe against simultaneous access. Use semaphores for synchronization. "


    Please note that: "No external libraries are needed to build this extension."

    --
    Ever need an online dictionary?
  78. Re:Java? Hardly. by RevAaron · · Score: 2, Informative

    Just curious, how can you have an object model without namespaces? Or interfaces for that matter? Isn't that like "New Car - with tires!"??

    Plenty of OO languages do not have namespaces. It isn't vital to an object system in the least. They are handy, but far from neccesary.

    Last I checked, you could only use SOAP to do this - has anyone tested how well that performs?

    Last you checked, you could only do what with SOAP? RPC calls? from PHP to anything else? There are plenty of ways to do something analogous to SOAP, homebrew and pre-built, text (like SOAP or XML-RPC) or binary based.

    (not that it matters, but you are donning the flamesuite, not "dawning" it.)

    --

    Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
  79. hahaha by Anonymous Coward · · Score: 0

    I wouldn't call C++, C for dummies as I find in large scale operations that C begins to look like a scripting language... meaning that it gets out of hand quickly in managing the dynamic set of logical components, data and connections. I like both and bastardize them whenever I can to get the best performance but then maybe my issue is with bad programming regardless of the language.

  80. which parts? by Anonymous Coward · · Score: 0
    when you say, "enterprise website" I assume you are talking of the communication aspects? As for the underlying core logic, this has been done. I think writing an entire core in Java is silly, personally but I think it is much less silly than writing it in something like Python (which is a great language... but does have its uses and thus limitations)

    On the other hand, if in writing even the core in a single language you are then free to avoid JNI crap (or anything else) then yes I can see the benefit. This is why .NET is another example of something that is such a great idea... but is being implemented in a very nasty way.

  81. SUEXEC sees you right even then by DrSkwid · · Score: 1

    okay so not impervious to attack, I never suggested that
    --
    Impact

    Anyone ... may exploit this vulnerability to gain access to any file readable by the user under which the webserver runs.
    --

    with SUEXEC that would be each website owner and it's group so www:$USER

    security minded people will already have locked down files outside the webspace to be unreadable by www that leaves the $USER's files.

    We use postgres and it's access is via current username rather than password so no passwords would be revealed.

    Arbitrary php execution would enable manipulating the DB data and open the door to other nasties [such as privilege escalation via forked shells & other vulnerabilities]

    In the end, though, you have to blame the existence of a Super-User model. It's the biggest hole there is.

    --
    There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
  82. Re:PHP Sucks by messju · · Score: 1

    i don't miss these. reasons:

    1. parametarization is not the duty of the mysql extension, but of functions/classes calling it.
    2. i think Server.MapPath hasn't been implemented in php since the differences between physical and virtual path are far more complex with apache as a hosting environment (i don't know how Server.MapPath should react on some URL-Rewriting-rules or when used in an 404-Error-page). but if you design you environment sane, providing a function that maps between files and urls is cake in php.
    3. i don't find this counter-intuitive.
    4. implement them *in* php, don't let your scripting environment put you in a niche. be creative.
    5 i feel repeating and do so: design the (file-system-)layout of your scripts well and mapping between them can be accomplished with very simple self-made functions that suit far better than anything embedded in the hoting environment, let it be apache (or another webserver) or php

  83. Kludgeola -in the name of Backward Compat by N8F8 · · Score: 1

    Do we really have to deal with kludges just to handle backward compatability? Sounds like a good time for a fork. I'd rather have clean syntax.

    --
    "God fights on the side with the best artillery." - Napoleon, Marshal of France - speaking truth to power
  84. Object model? Hardly. by Anonymous Coward · · Score: 0
    features in PHP5; highlights include the new object model, namespaces, interfaces, access control and exceptions.

    Of course, Perl has had all this for some time

    Perl has an object model? Interfaces? Exceptions? Access control?!?

    Except for bless Perl has just as much of an object model as assembly language. Those doing OO in assembly would probably just consider bless to be a convenience function.
  85. Re:PHP Sucks by the+eric+conspiracy · · Score: 1

    I think PHP sucks.

    In some sense I agree with you - I have had to spend time supporting a large site written in PHP spaghetti, so I have good reason to hate it. I've also had to deal with similar ASP sites, so I will argue that any difference between the two is insignificant.

    But there are applications where I think PHP is fine - places where cost is paramount. PHP is fine for throwaway prototypes, and it offers hosting companies the ability to offer a lot of functionality for a $10 a month site.

  86. Method Overloading looks funky. by nobodyman · · Score: 1

    So, I'm fuzzy on the whole method overloading thing (I know zilch about PHP, sorry).

    If I want to have two methods with the same name (but have different number of args), I have to implement a function called "__call()"? Doesn't that mean that I have to write all the logic for which execution path gets taken based upon the method name and arguments passed into __call()?

    Could a PHP expert help me out here, because unless I'm mistaken that looks unbelievably hokey. With Java, I can write two functions
    foo(int a);
    foo(int a, int b);
    ...and the runtime would be able to route calls to the right function. Is this not how PHP works?
    1. Re:Method Overloading looks funky. by Permission+Denied · · Score: 1
      With Java, I can write two functions
      foo(int a); foo(int a, int b);
      ...and the runtime would be able to route calls to the right function. Is this not how PHP works?

      No, php does not work like that. You cannot define two different functions using the same identifier in the same namespace and I imagine this isn't going to change for PHP5. This is a good thing. This makes it absolutely clear which function your code is calling, which vastly improves maintainability.

      In addition, php functions can have default arguments, unlike Java. Your example would work like this in PHP:

      function foo($a, $b = -1) { ... }

      If -1 is a legitimate value for $b (and $b can take on any integer value), you make the $b argument an object with a "set" and "unset" state (Java way) or you simply add another optional argument which specifies whether or not $b is valid (php way). This is not a nasty hack: you see a function call and you can immediately tell which function definition is used without examining any object hierarchy.

      In addition, php is dynamically typed, so function overloading makes no sense at all because a function's signature is simply the function's identifier. Look at other dynamically typed languages like Scheme and you will see that they do not implement the type of overloading that you speak of.

      There are two reasonable uses of C++-like function overloading: 1. simulating optional arguments, like this person wanted (first hit from google on "Java optional arguments"); and 2. behaving differently based upon the type of the argument, like this:

      void foo(int a);
      void foo(double a);
      As you can see, the second reason is useless with a dynamically-typed language. In addition, it can lead to all sort of problems in C++ and Java and should be avoided. Example: what if your program now has to deal with another type - say "BigInt" arbitray-precision integers, in addition to ints and doubles? You cannot subclass "int" since it is a primitive non-object, so you will have to modify all your code that uses "int a" and make "BigInt a" versions of the functions. If you can foresee the problem, you can use a wrapper object (Java's "Integer") while initially writing your function "foo" but you cannot fix existing code: if you have a library that uses "int" you need to re-write portions of it when your program grows past 32-bit integers.

      You may have been confused by the php5 example on the website:

      Class Hello
      {
      function __call($name, $args)
      {
      echo "Hello $name!\n";
      }
      }

      This has nothing to do with the C++ or Java notion of "overloading." The word "overloading" means something completely different in each language, and you won't get anywhere if you expect C++-like constructs in PHP.

      Unlike Java or C++ or most of the other C-syntax based procedural languages (with the notable exeption of Objective C), PHP has a dynamic run-time type system, which means it can implement dynamic run-time binding. What the php5 __call construct allows you to do is to bind identifiers at run-time. If you've studied Lisp or Scheme, you will understand the power of this. However, from the presentation, I do not see any way to define code at run-time (Lisp's lambda or perl's "sub {...}"), so it won't allow you to do functional programming. What (I believe) it will allow you to do is dynamic binding, like Objective C or Smalltalk. I can't quite figure out why this would be useful in php, however :)

    2. Re:Method Overloading looks funky. by OldMiner · · Score: 1
      void foo(int a);
      void foo(double a);
      As you can see, the second reason is useless with a dynamically-typed language. In addition, it can lead to all sort of problems in C++ and Java and should be avoided. Example: what if your program now has to deal with another type - say "BigInt" arbitray-precision integers, in addition to ints and doubles? You cannot subclass "int" since it is a primitive non-object, so you will have to modify all your code that uses "int a" and make "BigInt a" versions of the functions. If you can foresee the problem, you can use a wrapper object (Java's "Integer") while initially writing your function "foo" but you cannot fix existing code: if you have a library that uses "int" you need to re-write portions of it when your program grows past 32-bit integers.

      You'll excuse my meandering off the subject, but in C++ isn't this exactly the case for templates? [Ignoring the fact that templates can dramatically increase compile times and debug symbols.]

      template <class someType>
      void foo(someType a);
      --
      You like splinters in your crotch? -Jon Caldara
  87. Re:Java? Hardly. by kson34 · · Score: 2, Informative

    >You can throw it on top of an application layer to do the real work.
    >Last I checked, you could only use SOAP to do this - has anyone tested how well that performs?
    When did you last check, PHP3? PHP has had a Java binding, a Corba binding, and a COM binding for years (since early PHP4). And you can extend PHP with C if you need speed (rather than a more robust OO environment), you can even write your c code inline with php (see Inline_C) for a cool pear package.

    The added OO features (and more importantly for speed matters, the fact that objects are now passed by reference and not by value by default) are just going to be a bonus. Exception handling will be nice for large projects.

    >Just curious, how can you have an object model without namespaces? Or interfaces for that matter?

    The objects in PHP where initially just glorified arrays (like Javascript). However, interfaces and namespaces -- useful as they are -- are certainly not necessary for an object model. You can do very nice OO programming in C if you are disciplined enough. You don't really need the language to hold your hand.

  88. Re:PHP Sucks by stealthzap · · Score: 0

    Any code can be written in a spaghetti like fashion including PHP, java, perl, C++, etc...

    Conversely code written in any language can also be well documented, structured, and cleanly written. PHP can produce quite functional, stable, robust sites. It just so happens that lots of people get into writing code with php because it's easy to use, and they haven't necessarily had the training or experience to be able to understand good coding practices. It seems to me that lots of the features of php and perl including weak typing that make them easy to use, also provide a good opportunity to create hard to read code. Lots of comments make up for this, as do good variable names, but never knowing for certain what kind of a thing you have in your hands does make code hard(er) to debug, and read when there are problems. The ease of not having to understand typing and type casting does draw a lot of newb programmers to php and perl. And you can pay newb programmers less than expensive computer scientists. It's just a matter of getting what you pay for. A highly experienced php programmer is going to get paid more, and is going to be able to create the high traffic web applications like Yahoo. Just don't expect it from a newb programmer who doesn't understand an array from a vector.

  89. PHP offers OO in an exciting new way.. by Anonymous Coward · · Score: 0

    That is, it's exciting when it actually works....

  90. Scale by Synn · · Score: 4, Interesting

    I'm not too sure what kind of system/traffic your site had, but our company runs web-based apps for over 40 insurance agencies across the US.

    We have one server that hosts 42,000 lines of PHP code and sees around 1300 insurance agents each day who log in, generate term/ltc quotes and download forms.

    Most of the above code drills into a seperate MSSQL database server running Win2k, which actually has become our only bottleneck. That server fails rarely during very high traffic.

    Locally the web server also sports a MySQL database server instance which hosts a little under 5 megs worth of rates for Long Term Care quoting.

    For Term Life quoting I pull in a 50-200k XML datastream from an outside vendor.

    The server hosts 1.7gigs worth of downloadable insurance forms.

    All of this runs on a 1Ghz Pentium 3 with a half gig of ram. A good 300 megs of that ram is currently free.

    In the three years this has been running I've yet to see php cause a crash in apache.

    I'd say it scales pretty damn well.

    1. Re:Scale by destiney · · Score: 1


      Yeah, that guy is clueless. We have massive amounts of PHP code on load balanced systems and it gets slammed 24/7. PHP scales pretty damn good for my group of coders.

      His queries are probably "select * from ..." or some other dumb shit.

      Meanwhile mod_ruby is broke as fuck. For web page authors, ruby is really not an option at the moment.

    2. Re:Scale by christopherfinke · · Score: 1
      His queries are probably "select * from ..."
      I'm quite new to the language, but I'm using it to query MySQL databases and (usually) return the values from every row. What else besides "select * from..." could I be using?
    3. Re:Scale by jallen02 · · Score: 1

      Specifically selecting the columns you need so that the SQL server does not have to determine what the columns are. SELECT * isn't even really a performance hit in most modern RDBMS, though. In terms of data set size it still makes sense to select only the data columns you need. WHen you perform a query your application server software will have the entirety of that dataset available in memory usually, which means if you selected !needed columns you end up using more memory and being less efficient than possible.

      Jeremy

    4. Re:Scale by loconet · · Score: 1

      I agree with you.

      Most of the bottlenecks in php+mysql+apache projects is really mysql. And 80% of the time is bad database design or sql programmer's fault.

      One of the sites I develop and maintain gets about 13k-20k visitors per day and on peak times we get up to 200 requests /sec.

      It's all PHP + MySQL. Mind you, We use Pear caching..but there were 4 queries that went into a 200k+ records table and were locking the tables and bringing down the whole site! took those 4 lines of code out ..and PHP+Apache was processing the requests like nothing.

      --
      [alk]
    5. Re:Scale by mr3038 · · Score: 1
      Specifically selecting the columns you need so that the SQL server does not have to determine what the columns are. SELECT * isn't even really a performance hit in most modern RDBMS, though.

      More importantly, if you define in which order and which fields (columns) you want, you don't need to rewrite every damn piece of code that uses the results after adding one new column to the table because the result set stays the same. You could use views or something else instead as a workaround, but why to make the solution so hard? The problem certainly isn't.

      --
      _________________________
      Spelling and grammar mistakes left as an exercise for the reader.
  91. amen, brother by Anonymous Coward · · Score: 0
    while mysql is always promising to fix subselects or joins, or acid compliance or sql92 compliance or whatever, postgresql usually has had the same problem solved for 2 years.

    i've yet to meet somebody intelligent who tried out both mysql and postgresql and then didn't end up moving towards postgresql.

  92. Re:System-wide objects by Arethan · · Score: 2, Informative

    Unfortunately, there are issues with using shared memory that would be better off handled by PHP itself. The integer keys need to be unique, which can be a bit of a pain to generate in the first place, but also lead to issues if other software isn't written correctly and simply uses a hardcoded value. Next thing to you, your data is being screwed with by an unknown app.

    You'd probably be better off using a file based system that stores data in /tmp/phppersistant or something, and uses file locking to control access. Of course, you'd need to write it all yourself since I don't know of any existing class to perform this. Even then, nothing comes close to a native solution within PHP itself for speed and reliability. If it's so easy using shared memory, why isn't there already a built in solution using this that is part of the default compile? I'd guess that portability of PHP probably makes this solution useless. Last I checked, SysV IPC wasn't available on Wintel boxes. Sure, the functionality is duplicated within different API calls, but it really isn't SysV IPC.

    Don't want to sound demeaning, but I just don't see the practicality of using shared memory for something that should already be included natively. *shrug*

  93. Re:PHP Sucks by the+eric+conspiracy · · Score: 1

    Just don't expect it from a newb programmer who doesn't understand an array from a vector.

    The spaghetti site I ran into was written by an experienced programmer who had just come from an Ada shop. He knew all you said, but the project management was so screwed up that he did not get a chance to apply his skills.

    My personal opinion is that most spaghetti sites are not the fault of the programmer, but rather the people managing the project.

  94. Re:PHP Sucks by mgkimsal2 · · Score: 1

    The NAME="var[]" thing is a fucking hilarious hack. Every time I read that part of the PHP manual I simply can't stop giggling

    And you do this in VBScript how? I worked at an MS shop for awhile and no one there knew how to do this. Not saying it can't be done, but it certainly wasn't intuitive to people working there.

    If the syntax for dealing with arrays in a language uses [] as part of the syntax, using

    makes perfect sense.

    But trying to actually write your "real" code in PHP is a recipe for a hideous, convoluted mess.

    Sorry if you think that. We manage to write fully functional apps all the time in PHP which aren't even close to hideous or convoluted.

    Remember, you have to send a fully-qualified URL in your response.

    IIRC ASP doesn't so this, or at least didn't do this a few years ago. If PHP was *only* written to work with one web server and didn't have to worry about being run in multiple environments, this wouldn't be a problem. As it is, you can feel all smug and safe knowing that you have a command to send a full URL in your response. Whoopee. Many others of us have a very capable and dynamic cross-platform language which is well-suited to writing web-based apps, and we're not tied to a language which was shoehorned into a webserver against its will.

  95. PHP, Java and Problems with new gimmicks by theolein · · Score: 2, Interesting

    While I must admire the PHP developers for going totally overboard and finally adding features to the almost useless class system they had before, I have found that PHP's great strength has been in smaller websites that need simple code. Java has always been overkill in that arena.

    But what has become an increasingly presistant problem is the way that things that are commonly used such as the easy method of automatic variable creation with reg_globals = on, was changed to be default off and similar things that change in every .x rellease. The problem with that is that you don't know anymore if your code will "just work" on an unknown server, or if you're going to have to change php.ini and /or your code (if you do it the new way and the server is old it won't work and if you do the old way and the server is new...).

    This, in my opinion is starting to defeat the object of what made PHP so popular in the first place: making a small script easily in an easy language for a small site.

  96. perhaps by djupedal · · Score: 1

    ...with so many pages you would do well to spit out more dynamic content, rather than hardwire so many references? Or is that the situation that already exists.

  97. Re:Apache is Dying! Let's look at this months numb by Lxy · · Score: 2, Informative

    Sorry, I got in the wrong mind track. Too many "BSD is dying" posts screwed up my already messed up brain.

    --

    There is no reasonable defense against an idiot with an agenda
    :wq
  98. PHP anthem by ferkelparade · · Score: 1

    [sung over AC/DC's TNT]

    Oi, oi, oi, oi, oi, oi, oi, oi, oi, oi, oi, oi, oi, oi, oi

    See me code in the sunset
    On my 19" screen
    Out for all that I can get
    If you know what I mean
    mod_perl to the left of me
    IIS to the right
    Ain't got no shell
    Ain't got no life
    But don't you start no fight

    CHORUS:
    'Cause it's PHP, it's dynamite
    PHP it'll win the fight
    PHP it's a power load
    PHP watch it explode

    It's dirty, mean and mighty unclean
    It's a wanted man
    Public enemy number one
    Understand
    So lock up your server
    Lock up your files
    Lock up your back door
    And run for your life
    The code is back in town
    Don't you mess it 'round

    CHORUS
    PHP Oi, oi, oi
    PHP Oi, oi, oi
    PHP Oi, oi, oi
    PHP Oi, oi, oi
    PHP Oi
    It's dynamite (oi, oi)
    PHP Oi,
    It'll win the fight,
    PHP
    It's a power load
    PHP
    Watch it explode!

    --
    frotz grue
    1. Re:PHP anthem by katchins · · Score: 1

      DMCA will be contacting on posting lyrics without a valid copyright!

      --
      if (!sig) { printf("Signature Unavailable\n"); }
  99. People Helping People by bozojoe · · Score: 1

    There are 5 people helping people groups?
    Wow, whodu thought!

    --
    lick the cancle button (at least thats what our Chinese QA says)
  100. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  101. 5?! Get 4 right by belg4mit · · Score: 1

    PHP 5? I'd settle for a production mod_php 4
    that works with Apache 2.

    --
    Were that I say, pancakes?
  102. Some demo! by WebMasterJoe · · Score: 1
    I went to a mirror, and this example just doesn't look right:
    <?php
    namespace Language {
    ...
    class Perl {
    function exec_stmt($stmt) {
    $command = escapeshellcmd($stmt);
    system("echo $command | perl");
    }
    }
    ...
    }

    $p = new Language::Perl;
    $p->exec_stmt("print 'Hello Freaky Deaky World!'");
    ?>


    Parse error: parse error in /local/Web/sites/talks/presentations/slides/php5in tro/namespace.php on line 2
    Perhaps the mirror was using PHP 4?
    --
    I really hate signatures, but go to my website.
  103. Re:PHP5 wishlist - Session Variables by Anonymous Coward · · Score: 0

    Yeah, that's nice, but I'd rather have PHP handle this stuff for me. If I wanted to mess with shared memory and semaphores, I'd be coding the damn thing in C to begin with.

  104. one size does not fit all by bani · · Score: 1

    not all sites need oracle or postgresql, oracle is very resource hefty and expensive. the costs of oracle alone can tank a small business.

    plus, mysql is very light. this means it is ideal for embedded systems and PDAs. there's no way anyone is going to shoehorn oracle into a zaurus. mysql runs fine though on it.

    postgresql might be more feature-complete, but the community support for mysql is many times better.

    advocate oracle and postgresql all you like, it doesnt matter. one size does not fit all.

    1. Re:one size does not fit all by MmmmAqua · · Score: 1

      not all sites need oracle or postgresql, oracle is very resource hefty and expensive. the costs of oracle alone can tank a small business.

      plus, mysql is very light. this means it is ideal for embedded systems and PDAs. there's no way anyone is going to shoehorn oracle into a zaurus. mysql runs fine though on it.

      postgresql might be more feature-complete, but the community support for mysql is many times better.

      advocate oracle and postgresql all you like, it doesnt matter. one size does not fit all.


      Please read future posts before posting knee-jerk defensive reactions like this. Or did you miss the part where I said we use both MySQL and Oracle? We use MySQL because it is lightweight and runs well on limited hardware. Its' replication features are impressive, and we fully exploit them. We just don't use MySQL on mission-critical systems. We use Oracle because it is an outstanding product with amazing capabilities and support. Better support than even the vaunted community support of free/open software.

      Where do you get the idea that I'm saying Oracle is the One True Database, and all should bow down to the might Larry? Or are you just automatically going on the defensive because I dared to assert that MySQL is not enterprise-ready?

      --
      Arr! The laws of physics be a harsh mistress!
  105. Re:PHP Sucks by an_mo · · Score: 1

    what is a vector in php? Just curious.

  106. I wonder... by Mold · · Score: 1

    What the hell some people are doing to get these crashes. I've been using PHP for a few years now, and I've never had it seg fault on me, and it runs pretty damned fast (but I do use a compiler). Of course, my sites are pretty small (about nine domains of with about 200 constant users, not including other viewers, on one server), so it could just be happening on the larger servers.

    1. Re:I wonder... by etrnl · · Score: 1

      Try building Apache with DSO support, and building a DSO mod_perl, mod_php, mod_ssl, and a few other DSOs... It's not uncomment for the DSOs to not play nicely together.

      I've never had these combinations cause problems when I compiled them all statically together, but add DSO into the mix, and you'll probably run across Apache barfing every now and then.

      --etrnl

  107. I'll check it out, but... by mikemcc · · Score: 1

    I've been using PHP consistenly for the past four years or so (and Perl for about six years). I'll certainly look at PHP5 once its out of beta, but I must admit that even though the majority of my work over the past three years has been in PHP, all my recent work has been in Python.

    A while ago I did a lot of PHP intranet development using custom classes which talked to LDAP data sources, and I came away from my efforts with the feeling that PHP is architecturally inconsistent. Those inconsistencies left a bad taste in my mouth.

    I doubt I'll ever stop using Perl, but with only a little direct experience I can already see the day when I will have stopped using PHP in favor of Python.

  108. Perl alternative - HTML::Mason by TardisX · · Score: 1
    If you are a perl person, I can highly recommend you investigate HTML::Mason as an alternative to PHP.

    Visit the site if you want more details on what's good about it. In a nutshell:

    • Much easier seperation of presentation and logic
    • Easy templating and page filtering
    • Excellent but easy component caching (great for those slashdottings :-)
    • It's perl
    OK, the last sounds like flamebait, but being perl means you get CPAN, which is a massive boon to any perl coder, no matter the style of development you are participating in.

    Lastly, if you want to start from scratch, not having experience in either, can I humbly suggest you start with perl rather than PHP. You'll regret having to unlearn all the evil habits you get into once you start travelling the PHP road.

    --

    Command attempted to use minibuffer while in minibuffer
  109. Re:PHP Sucks by bellings · · Score: 1

    Many others of us have a very capable and dynamic cross-platform language which is well-suited to writing web-based apps, and we're not tied to a language which was shoehorned into a webserver against its will.

    No, you a poorly written, poorly thought out toy language, shoehorned into a third-rate web framework.

    I'm not a huge fan of ASP, but it's a marginally better framework than PHP. Of course, you can write ASP programs in Perl, Javascript, VBScript, and any other language that uses Window's active scripting framework.

    I'll gladly admit that nothing else freely available is as simple to get started with as PHP. That's not praise. In my mind, PHP serves as a perfect example of the reasons open-source software simply can not fill every need. A lot of people want a well-thought out, well documented, stable, relatively secure, and very simple to use web framework, similar to ASP. Unfortunately, no competent programmer wants such a thing badly enough to write it. However, a number of incompetent programmers have sat down and scratched their own itch, and come up with PHP.

    I'm certain that PHP would make a perfectly useful starting point to write a decent web framework. It really isn't missing that much before it would be useful. But, I've seen no evidence that anyone working on PHP has any interest in writing a decent web framework. And, I've seen no evidence that anyone interested in decent web frameworks is interested in PHP.

    --
    Slashdot is jumping the shark. I'm just driving the boat.
  110. Damn. I knew it. by Pflipp · · Score: 1

    I've been working since PHP 3 on a system to transparently store PHP object data in a database and get it out again just as easily. The system, which is set up to be more flexible than your average pseudo-OODB/ CMS (though it's not a full CMS), needs to take heavy use of the PHP object and class metaprogramming functionality. You'll notice when really relying upon it, that the PHP object and class API is a little bit scattered together.

    Now they're of course going to rewrite the object system so that it all gets better and easier and more mature, and my code will have to be rewritten from the ground up when I want to support PHP5.

    And I thought I was nearly done...

    --
    "We can confirm that Debian does *not* ship the version with the trojan horse. Our version predates it." [CA-2002-28]
  111. Re:Java? Hardly. by Pflipp · · Score: 1

    Just curious, how can you have an object model without namespaces? Or interfaces for that matter? Isn't that like "New Car - with tires!"??

    It's more like "Old Volkswagen Beetle - without steering reinforcement and airco, but still running as hell. Yep, they don't make 'em like they used to".

    The Smalltalk language, which popped the term "OO" (and the GUI), had neither namespaces nor interfaces. Yet, they've managed quite OK. The language did contain a more complete OO-vision than most languages have today, by making everything an object (it's a little bit more complex than that, but hey), including e.g. if-statements, code blocks, etc.

    "Modern" OO languages are almost always a cross-over from C-style syntax and OO-style behavior, which is not really all that disastrous, but sometimes a little bit mind-limiting to people. (For instance, did you realize you can have a full OO language without the concept of classes?)

    --
    "We can confirm that Debian does *not* ship the version with the trojan horse. Our version predates it." [CA-2002-28]
  112. Availble at talks.php.net by tomer · · Score: 1

    For those who can't enter the pages at ny1.php.net, it seems you can get 'em at talks.php.net (counting 34 pages).

    Enjoy.

  113. PHP does compile to Bytecode by mamahuhu · · Score: 1

    This site describes how you can complie PHP to byte code for a proposed PHP# implementation.

  114. parse error? by ghum · · Score: 1

    Is it just me? The mirror side gives me on slides 3 updwards:
    <?php
    define('NUM', 10);
    try {
    if (NUM throw new Exception(
    NUM . " is too small!"
    );
    }
    } catch (Exception $e) {
    echo $e->getMessage();
    echo "\n
    \n";
    }
    ?>
    Output

    Parse error: parse error in
    /local/Web/sites/talks/presentations/slides/php5in tro/except.php on line 3

    form other languages I remember different exceptions...

  115. Re:System-wide objects by Arethan · · Score: 1

    sorry about the 2nd thread, but I figured you wouldn't see this unless I posted this way.

    After sleeping on it, I thought of another reason why shared memory doesn't work. Objects that have filehandle references won't correctly persist, since the stream is closed when the php instance shuts down.

    A good example of why this is important is dabatase connection pooling. I've worked on a few large commercial websites, written in ASP, backended by Oracle. The system was already existing when I got there, I just helped make a few updates. The interesting part is that the pages were written to share a single database connection that persisted between requests. With a cluster of 25 webservers, and a few million hits a day, it was important to keep the database connections persistant to reduce the connect/disconnect load on Oracle. Instead of having to authenticate over a million connections a day, the Oracle DB was only required to authenticate a webserver on the first request served. The allowed the database to focus on serving out the required data, rather than fussing about opening and closing sockets all day long.

    Anyhow, just thought I would bring that up. :)

  116. Nice but we need Client side support by Delifisek · · Score: 0

    My programming knowladge based around PHP. I found it is very nice. It's very easy to learn (that's why I can write web programs. I try perl first. But I found it so confuzzy to understand others programs). Very easy to set it up. That's why its very popular. Also HTML is very easy too. (thats why web is so popular).

    Also I found MySQL is very easy to use and maintenance. When you combining PHP/MySQL/Apache, you will found very effective and easy to use web aplication server system.

    You may argue, beacuse of asp's bla bla option, beacuse of Java oo capabilities, beacause of Oracle's capabilites. I'm sorry all of them too complicate and and too expensive to create web aplications.

    On my side, PHP only lacks one area, Client side. Sending 10k data to clent for each time form loaded making (even using mod_gzip) network load. Also makes entire operation slow.

    We just needed, Flash like plugin for browsers.To do some php functions on client. Like graphics, like html. PHP don't need to compare other web technologies. It's much enough to do many things. And we need that god damn client side plugin.

    To create, more intereactively web applications. whih are running more faster, can do more thing withouth huge server load and of course escaping javascripts.

    Oh of course, there are lots of technologies to do what I we want and I say again, they are too complicated and expensive.

    Any PHP God Hear me ?. PHP is fine, of course it can be much better. And we need that client side plugin.

    Please consider our, cliend side PHP support. I strongly believe It is open very uncharted areas for PHP.

    Thanks

    --
    [My english is better than most other people's Turkish, so please point out mistakes politely. Thank you.]
  117. Mod Parent Up by slyborg · · Score: 1

    Mod parent up. Should be a separate JWZ +modifier.

  118. Threading by Anonymous Coward · · Score: 0

    Does PHP5 support the mean,evil,threading that would make it even more powerful then 4 currently is? Wonder if they will ever implement threads in it...

  119. JSP by Hard_Code · · Score: 1

    Man, PHP5 is looking suspiciously like Java/JSP... so besides the API differences, and the lack of equivalent ability of servlets, i'm wondering where PHP is going... I admit two benefits are "less configuration" and "better memory usage" (although the latter may well not hold with all these OO features being added)...

    --

    It's 10 PM. Do you know if you're un-American?
  120. Come to the light...[insert hot new language] by slyborg · · Score: 1

    Sigh. Being old and moldy, I have seen more "next great things" flow under the bridge than a lot of the slashdot crowd, and this stuff makes me tired. From the practical standpoint of "getting stuff done", I've come to the conclusion that all infrastructure is equivalent - database/coding language/operating system/etc. What these discussions always end up as is:

    - You Have To Check Out 'X', EVERYBODY Is Using It
    - (My Preferred System) 'Y' Can Do Everything 'X' Can, AND Can Do 'Z'!
    - 'X' Can Do 'Z' Too, You Just Need (Long Kludge)
    - So What, 'Q' Could Do 'Z' Back In (Current Date Minus At Least Ten Years)
    - My Bad Experience With 'X'
    - My Bad Experience With 'Y'
    - My Bad Experience With 'Z'
    - Long Incomprehensible Story About 'Q' Being Used On A Nuclear Submarine

    I have to say that the state of the computer science art has advanced since I went through my schooling, language design and implementation used to be a fairly abstruse topic, and now people knock out parsers at the drop of the hat. What it reminds me of is my experience in embedded systems. At one point, everybody working the field says to himself, "you know, I could write my own embedded OS, this isn't that hard, and I could put in this one feature..." I've whiled away many an hour deciphering some guy's brainchild to extract some tedious bug out of it, when any of four well-known solutions with known stable behavior could have been used instead and avoided the whole exercise.

    I'm not knocking people trying to do new things, this is how the art advances. But spare us the "use X (you fools) Y is complete rubbish!" arguments.

  121. full url for redirect by aint · · Score: 1
    Regarding the full url, how about something like:
    <?php
    function make_fullurl ($url) {

    if (!stristr($url, 'http://')) {
    $tmp = 'http://' . $_SERVER['SERVER_NAME'];

    if ($url{0} !== '/') {
    $tmp .= dirname($_SERVER['PHP_SELF']) . '/';
    }

    return $tmp . $url;
    }
    return $url;
    }
    ?>
    Should work for you although keep in mind it took just a few minutes so it's currently a "hack" ;-)
  122. a real man uses flatfiles by Anonymous Coward · · Score: 0

    and that does not include XML