Slashdot Mirror


PHP Security Expert Resigns

juct writes "PHP security holes have a name — quite often it was Stefan Esser who found and reported them. Now Esser has quit the PHP security team. He feels that his attempt to make PHP safer "from the inside" is futile. Basic security issues are not addressed sufficiently by the developers. Zeev Suraski, Zend's CTO of course disagrees and urges Stefan to work with the PHP development team instead of working against it. But given the number of remote code execution holes in PHP apps this year, Esser might have a point. And he plans to continue his quest for security holes in PHP. Only that from now on, he will publish them after reasonable time — regardless if a patch is available or not." Update: 10/30 12:57 GMT by KD : Zeev Suraski wrote in to protest: "I'm quoted as if I 'point fingers at inexperienced developers,' and of course, there's no link to that — because it's not true! The two issues — security problems in Web apps written in PHP, and security problems in PHP itself — are two distinct issues. Nobody, including myself, is saying that there are no security problems in PHP — not unlike pretty much any other piece of software. Nobody, I think, argues the fact that there have been many more security problems at the application level, then there were at the language level. I never replied to Stefan's accusations of security problems in PHP saying 'that's bull, it's all the developers' fault,' and I have no intention to do it in the future."

386 comments

  1. YAY by phantomcircuit · · Score: 1, Funny

    I for one would like to thank him for the nominal increase in success rates of attacks thanks to him!

    GREAT IDEA!!!!

    1. Re:YAY by ztransform · · Score: 0

      Hmm.. either way, at least Perl is under the radar for now..

    2. Re:YAY by Anonymous Coward · · Score: 0

      All this just so he could post the phrase "persona non grata" in his blog...

    3. Re:YAY by moro_666 · · Score: 2, Insightful

      That's because you're not opposing the 2 real things here. Unnoticed hackers abusing the bugs without nones knowledge versus letting everyone know where the bug is and that it exists in the first place.

        Quite often a quick-patch to slam a door is only a few lines. It may not be compatible with everything in the system, but it will do for some people. These patches never make it into the php right now and your ass is still uncovered for the skilled. It's interesting that you feel more comfortable with less information and the illusion that your application is safe.

        I think he's doing the right thing and once the storm passes everyone will agree that his move was the right one. We'll have less secret bugs and more patches for the open ones than we do right now.

        Everyone who has money inside the public php based applications will benefit after a year, although their sloppy code may not make them benefit from it tomorrow.

        You have to know your enemy, otherwise we're stuck on a system similar to windows where unknown shite lurks around and none even not the creators have any kind of idea where that last bastard worm came from.

      --

      I'd tell you the chances of this story being a dupe, but you wouldn't like it.
    4. Re:YAY by frost22 · · Score: 2, Insightful

      this exact story shows why disclosure continues to be necessary. Esser failed especially at getting PHP programmers to make PHP more secure. They summarily resited any of his effortsand suggestions, and in the end he felt isolated and antagonized. "the moment you criticize the security of PHP itself you become persona non grata" he wrote in his blog

      The sorry fact is that those assholes *have* to be forced. You *have* to beat sense into them, since apparently they are not accesiible to reason.

      So full disclosure continues to be the way to go.

      Heise has more details on the issue.

      --
      ...and here I stand, with all my lore, poor fool, no wiser than before.
    5. Re:YAY by SimHacker · · Score: 1

      The effect he has on the success rate of attacks pales in comparison to the effect the PHP's long track record of horrible bugs and design flaws has on the success rate of attacks. Blame the people who wrote the bugs and mis-designed all the security holes and language mis-features, not the people who want to fix them.

      If he raises people's awareness enough that some people STOP USING PHP, then he will have had a positive effect.

      -Don

      --
      Take a look and feel free: http://www.PieMenu.com
  2. Couple thoughts by BadAnalogyGuy · · Score: 2, Insightful

    First, the language is wide open for editing. It might help to be someone who not only finds bugs but fixes them.

    Second, it's PHP. Add another API or something.

    1. Re:Couple thoughts by masklinn · · Score: 1

      First, the language is wide open for editing.

      It's wide open for monkey patching, good luck if you want to:

      • Try to get into the source code, it's mostly unreadable
      • Try to get your patches accepted by Zend, you're headed for Funny Time

      Second, it's PHP. Add another API or something.

      I'd advise to switch to a language designed by a human, not a zombie.

      --
      "The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
    2. Re:Couple thoughts by EraserMouseMan · · Score: 1

      It's never going to get better if OSS devs always pass the buck. Developers enjoy writing the new features. Not many people enjoy fixing bugs.

      Whoever wrote the insecure code should be pointed out publicly and held responsible to fix his code.

    3. Re:Couple thoughts by Christianfreak · · Score: 2, Insightful

      Second, it's PHP. Add another API or something.

      Hahaha! Awesome! I'd suggest a few more functions in the global namespace as well. Maybe stop_hacking_attempts() and stop_hacking_attempts_l33t() ... with its parameters reversed of course!

    4. Re:Couple thoughts by jadavis · · Score: 1

      Developers enjoy writing the new features. Not many people enjoy fixing bugs.

      I don't necessarily think that's true. Often, bugs are just simple errors in corner cases. If you break out gdb and your favorite editor, you can often fix bugs in a matter of minutes, which is instantly satisfying. It really isn't even hard. You don't have to be a great programmer.

      I think the most important thing is a good community that gives you feedback quickly. If you submit a bug report or a patch, and it gets ignored, that's not a good feeling. I had a bad experience with the single bug report I issued to PHP.

      However, there are a lot of great projects where submitting patches can be satisfying. Also, you get to know the code better, and get on the good side of the community (which is nice when you have questions you need a good answer to). Not to mention that, but if you get patches into an important project, that looks great on a resume. If you're starting out a career, and you have several bug fixes accepted into any big project, you can easily ask for $10-20k more per year. That's a lot of money for a few hours' work here and there.

      --
      Social scientists are inspired by theories; scientists are humbled by facts.
    5. Re:Couple thoughts by EraserMouseMan · · Score: 1

      If you're starting out a career, and you have several bug fixes accepted into any big project, you can easily ask for $10-20k more per year.

      Whaaaaat?! First of all you can ask whatever you want. It's what you actually get offered that counts. It makes sense that you can gain credibility by having your name in a few press releases. But I'd really like to read an article or few that describe the $10-$20k increase. It seems to make sense but I'd just like to read more about it. Do you have a couple links?

    6. Re:Couple thoughts by SimHacker · · Score: 1

      As long as we were pulling numbers out of our asses: That $10-$20k increase doesn't nearly make up for the $40k decrease because you're dumb enough to use a horrible language like PHP.

      -Don

      --
      Take a look and feel free: http://www.PieMenu.com
    7. Re:Couple thoughts by Bishop · · Score: 1

      The problem with PHP is that it makes it easy to write bad code.

    8. Re:Couple thoughts by jadavis · · Score: 1

      But I'd really like to read an article or few that describe the $10-$20k increase.

      It's obviously going to matter a lot what project you help, and the quality of your work. There are no exact numbers.

      Keep in mind I said when you're starting your career. After that it's probably not going to make much difference. However, when all you have is a BS and maybe an entry level job beforehand, the community work you've done will matter a LOT.

      How many opportunities do employers have to actually look into how you work? If you work with the community, they see you in action. Of course, I guess if you don't know what you're doing that can be bad.

      --
      Social scientists are inspired by theories; scientists are humbled by facts.
  3. PHP Security Expert by mrshoe · · Score: 5, Funny
    PHP Security Expert...

    Isn't that an oxymoron?

    --
    There are two types of people in this world: those that categorize other people and those that don't.
    1. Re:PHP Security Expert by plierhead · · Score: 1, Interesting

      I know exactly nothing about PHP, except that putting it on my Fedora box was a prereq to installing the mambo CMS, so I followed the instructions exactly.

      My first introduction to php itself was about 6 weeks later when I found my network sagging under the load of a spam blast emanating from my now-compromised machine, broken into through a php exploit - kinda disgruntling and humiliating since I take the utmost care over security and this was the first ever breakin.

      The first reaction when I told someone at work about this was "yeah, you'd have to be mad to run php on a box you don't want to get owned".

      Lesson learned and now I would not touch php with a 20 ft pole.

      --

      [x] auto-moderate all posts by this user as insightful

    2. Re:PHP Security Expert by aaronwormus · · Score: 2, Insightful

      I hope this is a joke, as it's a typical clueless report that blames PHP for all their troubles.

      Obviously someone is NOT able to send spam though a machine JUST because they have PHP installed, the problem was with software that was installed on top of PHP.

      As some one who "takes utmost care over security" questions you should have ask were:
          - What version of PHP were you running
          - What version of Mambo were you running
          - Were you running any third party modules (most likely cause)
          - Were you on the Mambo security Mailing list

      If you were really interested in keeping a close eye on your server, you would have been aware of these things and wouldn't have put code which you weren't sure of on your server.

    3. Re:PHP Security Expert by Da+Fokka · · Score: 2, Funny

      I know exactly nothing about PHP...
       
      ... I take the utmost care over security and this was the first ever breakin.


      Would you call blindly installing a server side scripting language of which you know nothing 'taking utmost care over security'?

    4. Re:PHP Security Expert by Goaway · · Score: 1, Informative

      Obviously not, since he said it was embarrassing and now he doesn't do it. Awesome reading comprehension.

    5. Re:PHP Security Expert by Anonymous Coward · · Score: 0

      Ya, PHP is more farked than other alternatives.
      Albeit it is better than some older ones (i.e. TCL), but once one is exposed to other alternatives, it is not a star.

      For instance, having to escape everything from the application perspective, rather than have a library handle it.

              Perl and Python, with their default DB library interfaces allow for bind variables, which will be properly quoted (elleviates a good number of SQL-Injection issues).
              PHP and Pear (DB and MDB2) requires the application to do it all of the time.

      Hate for a language and its default libraries to offer more succinct ways of coding correctly.
      Not to mention that certain databases have much better performance when utilizing bind variables.

    6. Re:PHP Security Expert by Anonymous Coward · · Score: 0

      It's a bogonym!

  4. On second thought... by phantomcircuit · · Score: 5, Insightful

    On second thought I would have to agree that the majority of PHP flaws are due to unskilled programming.

    just have a look

    1. Re:On second thought... by sauge · · Score: 1

      These are great examples of how NOT to write code. I feel a little PDF book coming on in my fingers...

    2. Re:On second thought... by dam.capsule.org · · Score: 1

      The problem is PHP making it more difficult for a developer to program with security in mind. Escaping a value before putting it in an input tag should not take a whole "htmlentities($dangerous_user_value)" where a quicker "he($dangerous_user_value)" could do the job with less typing. Of course you can add that function yourself, but the framework should make it easy at first.

      Take the mysql_escape_string/mysql_real_escape_string thing. They could have one simple function to escape parameters of an SQL query and do the query like every other language (PreparedStatement in Java, I think perl DBI has them to, ActiveRecord for ruby on rails), but no, they assume the user is intelligent enough to escape correctly the parameters and choose the right function to do so. But PHP is often use by beginners so they don't know they need to escape parameters and they are not forced to do it so they won't know until some hackers use the hole to do some XSS tricks.

      Add to that the $_* variables mess, tons of bad named and bad designed API (think implose($array, ',') and explose(',', $array)) and you have completely confused developers developing insecure web applications.

      PHP was good five years ago but it has been lagging since.

      --
      What sig ?
    3. Re:On second thought... by aaronwormus · · Score: 1

      use PHP 5.2

      ext/filter takes care of a lot of the input filtering mess. PDO takes care of the database specific quoting, as well as prepared statements.

      PHP sucked 5 years ago, but is coming together now ;)

    4. Re:On second thought... by dam.capsule.org · · Score: 1

      I'll have a look at that for my next PHP work, thanks for the tip.

      --
      What sig ?
    5. Re:On second thought... by Jessta · · Score: 1

      A programming language should attempt to prevent a programmer from making these kinds of mistakes. By making the mistakes obvious in the syntax.

      --
      ...and that is all I have to say about that.
      http://jessta.id.au
    6. Re:On second thought... by cortana · · Score: 1

      The problem is that it will take years for all the commonly-used PHP applications to be rewritten to use these new interfaces, if they ever are at all. And in the meantime all the other criticisms of PHP will still continue to apply.

    7. Re:On second thought... by timmarhy · · Score: 1

      BULL-SHIT. PHP security problems are not due to inexperienced programmers, there are lots of inexperienced programmers out there many other languages, yet they don't produce anywhere near the vunerable systems php accounts for.

      --
      If you mod me down, I will become more powerful than you can imagine....
    8. Re:On second thought... by aaronwormus · · Score: 1

      PHP can be written securely without using these new interfaces, so old code does not need to be rewritten to be secure. PHP5 is gaining momentum amongst developers, everyone I know uses PHP5 for any new projects. So it's just a matter of time before it reaches critical mass and the applications that aren't ported over will stop being used. The same thing can be said about windows (I know it's a bad comparison), regardless of the patches that MS does to windows XP, there are still a couple hundred thousand windows ME machines out there working their little hearts out in botnets. The fact that people don't fix security issues in old code shouldn't effect the quality of development on the current platform.

    9. Re:On second thought... by kv9 · · Score: 1

      On second thought I would have to agree that the majority of PHP flaws are due to unskilled programming.

      exactly. yet the flamy blurb seems to be contradicting itself:

      Basic security issues are not addressed sufficiently by the developers. Zeev Suraski, Zend's CTO of course disagrees and points his finger at inexperienced programmers. But given the number of remote code execution holes in PHP apps this year, Esser might have a point. And he plans to continue his quest for security holes in PHP.

      so it's the apps, stupid. how many buffer overflows do we find every day in C/C++ applications? lots. yet I dont hear many people slamming the language. the only serious problem with PHP is the low barrier to entry, which allows every droolmonkey with a text editor to start coding.
    10. Re:On second thought... by DrSkwid · · Score: 0, Troll

      The file upload exploit wasn't programmer error and this was the biggest cause of site defacements via PHP seen so far.

      SQL Injection is the default mode of the PHP paradigm.

      PHP is a toy language. It should be drowned in a bucket.

      And I've been paid to program in it for longer than I care to remember though it was PHP3 when I started, you work it out :)

      --
      There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
    11. Re:On second thought... by John+Nowak · · Score: 1

      so it's the apps, stupid. how many buffer overflows do we find every day in C/C++ applications? lots. yet I dont hear many people slamming the language.

      Well, maybe you should be. C is a horrible language to use for writing an entire application with. Plenty of safe, higher-level languages with simple to use FFIs exist that are much better suited to such things.

    12. Re:On second thought... by /ASCII · · Score: 2, Insightful

      Actually, I hear lots and lots of people slamming C/C++ because it forces the programmer to do explicit memory managment, something humas are bad at, which leads to bugs and security issues. These people invariably advocate the use of more high level languages that automate and simplify common tasks, such as Java, Python or... PHP.

      The blame for the PHP security mess should be shared between the language design, which makes it a hassle to write secure code, and the language popularity, which means that PHP is the language choice of 50 million incompetent programmer wannabes.

      --
      Try out fish, the friendly interactive shell.
    13. Re:On second thought... by kv9 · · Score: 2, Insightful

      Well, maybe you should be. C is a horrible language to use for writing an entire application with. Plenty of safe, higher-level languages with simple to use FFIs exist that are much better suited to such things.

      you keep telling yourself that. meanwhile, in the real world, C/C++ will remain the workhorse of the IT industry.
    14. Re:On second thought... by seanyboy · · Score: 1

      PHP should escape automatically and anything that needs to be placed into the database raw should have be moved there via an "unescape" function. Why is the default functionality "Do this the dangerous way".

      It should also have fixed classes for encoding / decoding HTML. Every PHP project out there has its own weird and badly written way of cleaning entered HTML. Personally, I'd like to see the best of those aggregated into know PHP functions.

      I've got a b2evo site running on PHP and any changes I make to it terrify me. I don't know the language well enough to make or know that it's safe. You can blame my inexperience here and you've every right to, but personally I'd prefer it if the developers of PHP took care of that and left me to the task of providing the features my users want.

      --
      Training monkeys for world domination since 1439
    15. Re:On second thought... by Anonymous Coward · · Score: 0
      PHP should escape automatically

      you mean magic_quotes_gpc? that flag that everybody hates and wanted to see turned off by default?
    16. Re:On second thought... by masklinn · · Score: 1

      PHP should escape automatically and anything that needs to be placed into the database raw should have be moved there via an "unescape" function. Why is the default functionality "Do this the dangerous way".

      Oh yeah, magic_quotes worked sooo well didn't it?

      --
      "The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
    17. Re:On second thought... by Anonymous Coward · · Score: 0
      (really, Slashdot, why can't you make the interface LESS GODDAMN BROKEN?)


      Becasue Perl rocks and PHP sucks! Hahahahah! I have never seen a popular PHP application as badly broken and slow as the perl slashcode. I'd hate to think of the result if slashcode was written in PHP. Slashdot would have been owned the minute it went online.

      PHP is perfectly secure if configured properly and if run by an admin who knows what he's doing with only scripts by competent authors installed. PHP gets a reputation of being insecure because KIDS install it on the FEDORA servers and proceed to install boatloads of scripts written by other KIDS and then complain when they get owned.

      I have setup dozens of Windows/Apache/MySQL/PHP servers over the years, none of them have ever been touched, all perfectly secure. People who's WAMP servers get owned simply do not know what they are doing. It is that simple. Yet all the kids who just discovered the crap OS Fedora claim that WAMP is inherently insecure - no you just need to experienced and competent to run it securely. WAMP is for ADULTS - I wish it came with a child proof cap.

      Any Perl scripts I have ever installed, I keep private so that the server cpu is not constantly raped by it.

      But hey, don't let this old fart get i the way of the kiddie php sucks circle jerk. I' have only known what I'm doing in this business for 12 years. Why all these Fedora kiddies almost certainly know way more than me of course.

      Sigh, its a kids world, right or wrong be damned. DAMN KIDS! GET OFF MY LAWN!!!! Heh.
    18. Re:On second thought... by Goaway · · Score: 0, Troll

      PHP is perfectly secure if configured properly and if run by an admin who knows what he's doing with only scripts by competent authors installed.

      Yeah, good luck finding those. I'm sure they exist, but really, it's a lot less work to just not let PHP near your machine, ever.

    19. Re:On second thought... by TheRaven64 · · Score: 1

      The problem with PHP and database access is that it encourages you to construct SQL statements. Most DB client libraries have function that take SQL statements with placeholders for the variables, and compile them. You then pass the compiled version and the arguments to another function. This makes SQL injection impossible, because you never put anything directly into the SQL. If there is some kind of way of exploiting this, it is a bug in the DB client library, not your code. I believe newer versions of PHP have wrapper functions around these for some DBs, but not for others.

      --
      I am TheRaven on Soylent News
    20. Re:On second thought... by Fweeky · · Score: 1

      Yeah, let's not bother even talking about it, one should never try to work against intertia, even if it might do some good. After all, if it's got so much of it, and if so many people use it for everything, it must be the best way, right?

    21. Re:On second thought... by kv9 · · Score: 1

      we can talk about it all you want. when the numbers change, it will actually matter. I'm all for progress, but badmouthing such tried and proven things like C/C++ in favor of fancy-scripting-du-jour, just ain't cool my friend. and all that because some people cant't handle the complexity. tough shit. IT ain't easy.

    22. Re:On second thought... by Fweeky · · Score: 1

      I never said anything about what I was in favour of. Pointing to a set of artificial numbers doesn't really help, either; for 99% of cases they're irrelevent past a point most languages reach with ease (and by those numbers, a language with somewhat nicer looking semantics than C/++ seems to be winning); where they are relevent, dipping into a lower level language just for that is normally a better choice than doing your entire app in C. Alternate hard and soft layers. Plenty of systems, including games, follow this pattern.

      Yes, IT's not easy, but most of the real complexity is in the data and the algorithms you use; adding more complexity to everything by using a basic very low level language for the sake of performance you normally don't need is just silly. Frankly, even when performance is needed, languages like C/++ are often still too low level -- you should be able to trade off less in the way of programmer friendliness without removing significant chunks of performance. But now I'm handwaving :P

    23. Re:On second thought... by Stradivarius · · Score: 1

      and all that because some people cant't handle the complexity. tough shit. IT ain't easy

      No it isn't. But usually our solution as engineers/developers to things that people have trouble handling is to redesign the systems to better meet the user's needs and capabilities. After all, technology is supposed to serve mankind, not the other way around.

      In our 35 years or so of experience since the invention of C, the industry has learned lots of ways to do better. The result is things like C++, Java, and yes, the "fancy-scripting-du-jour" :-)

      As a point of comparison, C was invented around 1972, while the Ford Pinto came out in 1971. The Pinto, like C, will usually get you where you need to go. But the Pinto, like C, has this unfortunate habit of bursting into flames when you make certain types of mistakes. Modern cars and programming languages, on the other hand, generally do not. They even throw in a few extra amenities.

      It's not bad-mouthing the Pinto to suggest to your friends that perhaps a Pinto is not the best choice in this day and age. If a Pinto is all you've got and can afford, then good luck, and be sure to drive slowly for your own safety. Otherwise, it's worth considering a newer model.

    24. Re:On second thought... by kv9 · · Score: 1

      As a point of comparison, C was invented around 1972, while the Ford Pinto came out in 1971.

      thanks for the car analogy.

  5. PHP reminds me of IIS4 by 93+Escort+Wagon · · Score: 4, Insightful

    We have a large group of students, staff, and faculty that all have varying degrees of write access to a departmental Apache web server. Every few weeks someone asks why we're not giving people PHP access. Users love PHP because it's so easy; it makes them feel like they're clever programmers. But it seems like security knowledge is never imparted alongside the PHP training. People seem to think it's as benign as plain old HTML. When they ask for PHP I tell them we have a policy about not giving scripting-level access to users without good justification, and they have no idea why that applies to them since "we don't want to do any scripting; we just want to make PHP web pages".

    But even leaving all that aside - it seems like every SANS newsletter has multiple announcements either about a bug in some popular bit of PHP-based software, or else in PHP in general. Until that changes, we're sticking to Perl and Python. It's funny, in a way, since the first time I saw PHP I immediately thought of the days when I was writing Active Server Pages on IIS4, because structurally it is so similar - and now we all realize the similarities on the security side (or lack thereof) as well.

    --
    #DeleteChrome
    1. Re:PHP reminds me of IIS4 by Anonymous Coward · · Score: 0

      The real problem seems to be a scripting language being too easy, so that anyone without any clue about security can get something that seems to work exposed on the internet.

      Much of the PHP and Classic ASP "code" I've seen was garbage. I'm not saying all of it is garbage, but an awful lot of it sure is.

      No language can prevent n00bs from creating SQL queries via string concatenation (vs prepared statements/parameterized queries) and such.

      Not that PHP is a well designed scripting language nor that it's secure (I think it's trash), but either ways the main problem is with the people using the technology.

      You don't typically see insecure code like that in programs made in languages where people actually have to learn programming before they can use it... Making something too simple might be a mistake sometimes.

    2. Re:PHP reminds me of IIS4 by mixnblend · · Score: 1

      "we don't want to do any scripting; we just want to make PHP web pages"

      Well, theres pretty much all the justification you need for not giving them access right there...:)oh nice usage of the semi-colon by the way, such an under-utilised form of punctuation in this day and age:)

    3. Re:PHP reminds me of IIS4 by Bryansix · · Score: 1

      I'm sorry but every shared hosting plan on the market right now supports PHP and MySQL. Are you implying that they are running a setup so insecure that a script (or some PHP code) from one client will screw up another clients? If you are not implying that then why can't you get off your lazy ass and setup a system just like they use so the students can write some damn PHP and actually LEARN! Geez! I'm tired of these Network Admins at schools using backwards (chicken before the egg) arguments.

    4. Re:PHP reminds me of IIS4 by stridebird · · Score: 1

      ...you mean the SANS, who have a site, powered by, er, php?

      http://www.sans.org/index.php

      And as to structurally similar to ASP? Put down the pipe...
      ASP isn't even a language. First link from google:
      http://www.webwizguide.info/asp/tutorials/what_is_ asp.asp

  6. Re:php is the best language still by Divebus · · Score: 2, Interesting

    Huge problem is "default" installs - everyone knows where your sample scripts are. Delete those first thing then move/rename the active libraries.

    Now, where's that Ruby book?

    --

    Most of the stuff on /. won't survive first contact with facts.
  7. Re:Lemme guess... MySQL is also the best database? by Shads · · Score: 3, Funny

    Any language is only as good as the programmer using it.

    I use a LAMP stack for the most part, many of the security holes in php aren't due to the language itself but the developers of the various webapps.

    That being said, this requires a repost of the ol Adminspotting thang.

    Choose no life. Choose no career. Choose no family.
    Choose a fucking big computer, choose disk arrays the
    size of washing machines, modem racks, CD-ROM writers,
    and electrical coffee makers. Choose no sleep, high
    caffeine and mental insurance. Choose no friends.
    Choose black jeans and matching combat boots. Choose
    chairs for your office in a range of fucking fabrics.
    Choose SMTP and wondering why the fuck you are logged
    on on a sunday morning. Choose sitting in that swivel
    chair looking at mind-numbing, spirit-crushing web sites,
    stuffing fucking junk food into your mouth. Choose
    rotting away at the end of it all, pishing your last in
    some miserable newsgroup, nothing more than an
    embarassment to the selfish, fucked up lusers Gates
    spawned to replace the computer-literate.

    Choose your future.
    Choose to sysadmin.

    --
    Shadus
  8. Open source is the issue by Anonymous Coward · · Score: 3, Funny

    It's widely acknowledged that open source programs are inherently insecure. Whether the cause is the availability of the "internal blueprints", the free-for-all repository commit access, or the rampant theft of patents, one wonders. By contrast, Microsoft's .NET platform, including the widely praised C#, doesn't have this problem. The guarding of the internal source code, the standards-adhering developers, and the rock-solid legality of its software patents gives Microsoft an advantage versus the haphazard "open source" languages like PHP and Java. One wonders if this is a harbinger of future defections in the open source language camp. Speaking as a patent lawyer, I advise all developers to switch to .NET and Microsoft's enterprise-class C#.

    1. Re:Open source is the issue by The+Bungi · · Score: 1
      I've always had a problem with the "LOLOL M$ SUXX" crowd, but this is stupid. The Apache code is also available, and it doesn't have these problems. The problem is the basic design of PHP, compounded by the large number of "developers" that have taken it up as the language du jour instead of using better-designed platforms like Python, Ruby or Java. Or yes, any of the .NET languages and ASP/IIS.

      As I finished typing this I realized I'm probably feeding the troll ("patent lawyer", right) but oh well...

    2. Re:Open source is the issue by man_of_mr_e · · Score: 0, Troll

      The Apache code is also available, and it doesn't have these problems.

      Have you noticed how many sever security flaws have been reported in Apache in the last few years?

      Here's an exercise. Count the number of severe (or even not severe) flaws in IIS6 over the last 3 years, then compare that number to the number of severe (not even counting non-severe) flaws in Apache in the last year alone. Then compare the number of severe flaws in PHP this year and compare them to the total number of flaws in ASP.NET since it's inception 4 years ago.

      Report back your results.

    3. Re:Open source is the issue by Henry+2.0 · · Score: 1

      MOD PARENT UP!!! FUNNY

      It's widely acknowledged that open source programs are inherently insecure.

      hahaha - you sir, are a baboon.

      I love when the lawyers come and mix it up with the /. crowd

    4. Re:Open source is the issue by Anonymous Coward · · Score: 1, Informative

      Very true. My company just won a large contract to convert an app from a LAMP stack to a .NET 2.0/SQL 2k5 stack.

      What sold the client was the rock-solid reputation of the .NET stack compared to LAMP, as well as the fact that we can acheive more TPM then LAMP on the same hardware.

    5. Re:Open source is the issue by Almahtar · · Score: 0, Offtopic

      Bugs reported != bugs that exist, genius. Just because less bugs were reported for IIS doesn't mean there aren't as many or more: just that there aren't as many that are known and being worked on. Obscurity != securty, and anyone who actually knows information assurance knows that.

    6. Re:Open source is the issue by Anonymous Coward · · Score: 0

      Lawyers are the issue. They are clueless ignorant unprofessional expensive amoral useless selfish people that have nothing better to do than whoring for Microsoft's money.
      I, as a developer, recomend software companies stop hiring patent lawyers. ;-)

    7. Re:Open source is the issue by man_of_mr_e · · Score: 1

      You're forgetting that obscurity didn't prevent IIS 6 from being one of the most targeted services. Remember Code Red? Nimda? IIS was actively being probed and assaulted looking for flaws, and that didn't just stop. It stopped because IIS6 was basically rewritten from scratch and was configured by default in a secure way.

      Maybe there are flaws waiting to be discovered, but it doesn't change the point I was making, which is that the original post I responded to claimed that Apache hasn't had security flaws, but it has.. lots of them. And compared to the competitors products, especially when that competitor is Microsoft... that's just crazy.

    8. Re:Open source is the issue by man_of_mr_e · · Score: 1

      that should be "didn't prevent IIS < 6" ....

    9. Re:Open source is the issue by Beryllium+Sphere(tm) · · Score: 2, Insightful

      >open source programs are inherently insecure

      Let's lock this person in a room with the OpenBSD developers.

      Not a bad troll though.

    10. Re:Open source is the issue by timmarhy · · Score: 1

      "It's widely acknowledged that open source programs are inherently insecure" - FUD. don't feed the trolls. he has no valid point what so ever.

      --
      If you mod me down, I will become more powerful than you can imagine....
    11. Re:Open source is the issue by jasonwc · · Score: 2, Informative

      Perhaps I'm the only one that noticed, but I'm quite sure the parent was being sarcastic.

    12. Re:Open source is the issue by Jackmn · · Score: 1
      Perhaps I'm the only one that noticed, but I'm quite sure the parent was being sarcastic.
      It was painfully obvious. I can only hope the people replying seriously were themselves trolling for "it's a joke!' type responses.
    13. Re:Open source is the issue by tyldis · · Score: 1

      Not to mention that there are people like me: I never file bugs on MS products, I don't think they would listen. OSS projects tend to be very responsive and hence I file more bug reports.

    14. Re:Open source is the issue by Anonymous Coward · · Score: 0

      Your client is a sucker and a fool.

  9. Re:php is the best language still by Anonymous Coward · · Score: 1, Interesting

    "Huge problem is "default" installs"

    Huge problem is the lack of proper ingineering efforts.

    PHP seems to me quite a good language for the task at hand, and its popularity seems to agree with me. Probably some PHP core developers are quite good at defining/devoloping it. The problem is that for a good product to be born that's not enough. Then you need people with proper ingineering knowledge and *attitude* and that I feel severily lack this people.

    It's not only security flaws within the core of it, which is a clear symptom (while proper ingineering efforts would reduce them with time) it's they mix security fixes with new functionality; they change the interpreter behaviour and default options within minor releases... Those are symptoms of the underlying illness: bad ingineering attitude.

    And it doesn't seem to change in the future; quite a pity.

  10. Being a code monkey myself... by toadlife · · Score: 1

    ...I must ask what you mean when you said PHP and ASP are "structurally similar". I'm assuming you mean vbscript, (as an ".asp" page can actually be written in many different languages), and I don't see much similarity between them, at least as far as their syntax.

    --
    I don't always use unix-like operating systems; but when I do, I prefer FreeBSD.
    1. Re:Being a code monkey myself... by FooAtWFU · · Score: 1

      I think it's more like the:

      <html><body><h1>HTML page</h1>
      <? echo("<p>Hello!</p>"); ?>
      <% Response.write("<p>foo</p>"); %>
      </body></html>

      embedded-code-via-fancy-tag business.
      (And, well, so much for logic/presentation separation...)

      --
      The World Wide Web is dying. Soon, we shall have only the Internet.
    2. Re:Being a code monkey myself... by Shados · · Score: 1

      The similarity is in the templating system. How you integrate code between tags inside an HTML template.

      That has been the demise of ASP, in my opinion. ASP, by design, is supposed to be the "glue" between COMs, not actualy be used as the language itself, like PHP. Tons of ASP apps have been written using the PHP architecture, because it is "possible", and it simply doesn't work well there. Fortunately, ASP.NET fixed that...almost. Now we have all the noobs writting all their logic in the code behind instead ::sighs::

      Anyway, just to confirm what toadlife is saying. PHP and ASP only look similar to the untrained eye. The architecture and the way they are meant to be used is TOTALLY different.

    3. Re:Being a code monkey myself... by toadlife · · Score: 1

      Ok. Since the only two web scripting languages I've ever used were php and asp/vbscript, I had never considered that obvious similarity.

      --
      I don't always use unix-like operating systems; but when I do, I prefer FreeBSD.
    4. Re:Being a code monkey myself... by vhogemann · · Score: 1

      Both mix code with the view layer.

      Yes, I know is possible to separate the application logic from the view on ASP and PHP, but most of the time people just cram the pages with code, making it illegible. Also, bad PHP and ASP programmers tend to use global variables for everything, making you wonder where that little guy named connSQL3_spaz4 came from.

      A friend of mine told me once that: "PHP is the VisualBasic of OpenSource"... I couldn't agree more.

      --
      ---- You know how some doctors have the Messiah complex - they need to save the world? You've got the "Rubik's" complex
    5. Re:Being a code monkey myself... by 1110110001 · · Score: 1
      Yeah because perl is much different

      $name_of_world = 'mars';
      print <<ETX;
      <p>hello ${name_of_world}</p>
      ETX
      and it's also not possible to write such bad code in python:

      name_of_world = 'mars'
      print """
      <p>hello """ + name_of_world + """</p>
      """
      Actually the only difference in PHP is the default mode being "output mode" instead of "code mode". Everything else is the same in every language. PHP might be easier to learn, so stupid people might like PHP better.
    6. Re:Being a code monkey myself... by 93+Escort+Wagon · · Score: 1

      "The similarity is in the templating system. How you integrate code between tags inside an HTML template."

      Yes, that is exactly what I meant - sorry if I wasn't clear.

      --
      #DeleteChrome
  11. Actual announcement by kjart · · Score: 4, Interesting

    Here's the announcement from the source himself, via his blog. Based on that post I'd say he sounds pretty disgruntled with how his efforts towards security were received i.e. "he PHP Group will jump into your boat as soon you try to blame PHP's security problems on the user but the moment you criticize the security of PHP itself you become persona non grata"

    1. Re:Actual announcement by Bogtha · · Score: 2, Interesting

      he sounds pretty disgruntled with how his efforts towards security were received

      I'm not surprised. If you read the article, you come across this gem:

      Suraski expressed his regret at Esser's resignation from the security team and hoped that Esser might come to his senses and return. He also hoped that Esser would not turn against the PHP project. The "Month of PHP security bugs" proposed by Esser for 2007 would harm the project.

      That's right, the PHP team think that dedicating a month to finding security holes in PHP is "harming the project".

      Stefan has a bit of a reputation for being "abrasive". But in my opinion, it is because he's got decent (not unreasonable, but decent) quality standards, and isn't afraid to hold other people to them. In a normal project, that wouldn't be so bad, but given the prevailing attitudes of the PHP project, it's understandable that he blows up frequently enough to have a reputation.

      --
      Bogtha Bogtha Bogtha
    2. Re:Actual announcement by 1110110001 · · Score: 1

      Maybe Esser should change how he says things. Using words like "And now please die or just shut the fuck up. I am sick of morons like you who believe they can attack me without knowing the facts." doesn't help. He's just to much the "do what I say" type of person, but don't tell him or you're as stupid as all these PHP people.

    3. Re:Actual announcement by Anonymous Coward · · Score: 0

      I looked at the exchange. The guy he's replying to sure sounds like a moron, witness:

      "Stefan should define in which side he is. He pretends to be a PHP developer, but he doesn't act as one, as it posted a message in his blog saying that a product that he supposedly helps to make is insecure.. This is not really ethical, IMHO."

      If Stefan was at the time the #1 contributer on the security response team, I can understand his frustration hearing some twit prattle on without a clue.

      YMMV and probably does.

  12. Question from a .NET developer trying to go OSS... by JacksBrokenCode · · Score: 1

    Are there better alternatives to PHP or is the answer just better coding practices while using PHP?

    I ask because the majority of my experience is with C# and ASP.NET but I'm currently working on a project where the client would prefer to go with open-source alternatives. I'm not well versed in other platforms but have been looking at Apache/PHP/MySQL based on popularity & community. Ease of development is somewhat important, but speed & longevity (including security) are more important.

    Sorry if this is a dumb question, I've never developed anything serious on a FOSS platform before.

  13. XSS by default by Anonymous Coward · · Score: 5, Funny

    When I looked at Zend's introduction to PHP, the first sample PHP program was Hello World, and the second was a cross-site scripting vulnerability. Right, I'm going to trust these people.

    1. Re:XSS by default by Anonymous Coward · · Score: 1, Interesting

      A lot of 'Learn C' tutorials/books/etc have potential buffer overflows in the examples.
      A lot of 'Learn Perl' tutorials/books/etc have potential XSS/nullbyte exploits in the examples.
      etc.

    2. Re:XSS by default by Anonymous Coward · · Score: 0

      So, what book or other resource would anyone recommend as a good source to learn secure php programming?

    3. Re:XSS by default by Diacre · · Score: 1

      I found and learned from a good book called Pro PHP Security by Chris Snyder and Michael Southwell. It is publisheshed by apress. http://www.apress.com/

    4. Re:XSS by default by Goaway · · Score: 1, Troll

      A book on some other language. Do yourself a favor and get out of the landmine-filled sandbox.

  14. Re:Question from a .NET developer trying to go OSS by afd8856 · · Score: 1

    Zope 3, Turbogears, Django, Pylons, etc.

    --
    I'll do the stupid thing first and then you shy people follow...
  15. Re:Question from a .NET developer trying to go OSS by mano_k · · Score: 5, Insightful

    There sure are better alternatives to PHP in the OSS sector! PHP IMHO is a nice toy but nothing I would use in a commercial project.

    A soon to be totally OS sollution is of course JAVA with Apache and Servlets/JSP. Just take a look at Sun's website, they have a lot of information, examples and tutorials available. Also, Java is totally plattform independent and easily installed on Windows, if that remains your development system.

    Another, more recent sollution would be Ruby on Rails, which has some realy niffty features.

    And no, not a dumb question at all! One hint: If you got the time, just download the OSS you are considering ang play around with it, that's probably more usefull than my dumb answer. ;-)

  16. Re:Question from a .NET developer trying to go OSS by siddesu · · Score: 2, Informative

    there is a wide choice of languages and platforms.

    languages: there's java, there's python, there's perl, and there are more. each of the first three is (IMHO) a lot better than php (as I know it, up to about v. 4) for building web applications.

    servers: Apache, with either mod_perl or mod_python access to the APIs is very good. Of course, there's the plenty of java web servers and ways to run those with or without Apache.

    platforms: look at the Apache foundation's site for java, perl and python modules.

    development environment: I prefer Eclipse, but there are a few to choose from.

    Good luck,

  17. As a PHP user.... by MasterC · · Score: 4, Interesting

    As a PHP user, I have attempted to better the thing by reporting what I think are bugs. I can't name a single one that wasn't closed with a WONTFIX and a terse, non-thankful "that is a feature, not a bug." I honestly have zero disbelief that those same programmers would turn against Esser when he blamed the language, not the user, for the security problem.

    In particular, the late static binding issue (if B extends A then A::staticFunc() ran as B::staticFunc() is ran under class A not B). It's like how it took MySQL took a decade to get stored procedures and views despite many people asking for it. Many people complain about the late static binding issue but last I knew it was still "it's a feature, not a bug."

    Regardless, thanks for your work Mr. Esser...

    --
    :wq
    1. Re:As a PHP user.... by Shados · · Score: 3, Funny
      non-thankful "that is a feature, not a bug."
      Oh boy...Microsoft bought out PHP...
    2. Re:As a PHP user.... by Parker+Lewis · · Score: 0

      I already did a lot of posts in the bugs.php.net, but always take too the "that is a feature, not a bug".

    3. Re:As a PHP user.... by Splab · · Score: 4, Informative

      Amen to that.

      I had a fun one where one of my scripts would cause a segmentationfault, after hours of debug I found that they don't check the return from malloc when you call a function, so a very deep recursive function will result in a segfault. Now I had the problem with an actual system with 1000s of lines, so I made the simplest possible:

      function foo($a){
          echo $a . "\n";
          foo($a+1);
      }
      foo(1);

      Now this is of course a stupid function since it will never terminate, but it illustrates the point of the segmentation fault, I don't mind that deep recursive functions can exhaust the memory available, but I do mind the way the system handles the problem.

      The bug got rejected, and that was that. I don't do PHP anymore, so I don't really care about that any more.

    4. Re:As a PHP user.... by Anonymous Coward · · Score: 0
      Now this is of course a stupid function since it will never terminate, but it illustrates the point of the segmentation fault, I don't mind that deep recursive functions can exhaust the memory available, but I do mind the way the system handles the problem.

      The bug got rejected, and that was that. I don't do PHP anymore, so I don't really care about that any more.


      Excessive function recursion is the result of poor design and the refuge of lazy coders with no regard for the cost of server hardware.

      You're probably better of using a scripting language like perl that has no regard whatsoever for system resources and that will cover your ass for you in general anyway.
    5. Re:As a PHP user.... by shutdown+-p+now · · Score: 1

      Do you understand what "graceful termination" means?

    6. Re:As a PHP user.... by fire-eyes · · Score: 1

      Interesting. Can you please give us some URLs to some of these bugs? Not sure what to search for on their bugs page.

      --
      -- Note: If you don't agree with me, don't bother replying. I won't read it.
    7. Re:As a PHP user.... by iluvcapra · · Score: 2, Insightful

      Just to offer the alternate case:

      #!/usr/bin/ruby
      def recurse(x)
      x += 1
      recurse x
      end
      recurse 1

      If you run this, ruby will not segfault, but the interpreter will raise an Exception, so, you could do this:

      begin
      recurse 1
      rescue SystemStackError
      $stderr.print "recurse went to deep, continuing!...\n"
      end
      # and anything after this point will run as if there was no problem.

      Just for the record, recursion is a basic tool of programming, as basic as a reference type, and certain languages, like Haskell or Scheme or Lisp, use it implicitly and derive their power from it.

      --
      Don't blame me, I voted for Baltar.
    8. Re:As a PHP user.... by 1110110001 · · Score: 1

      In particular, the late static binding issue (if B extends A then A::staticFunc() ran as B::staticFunc() is ran under class A not B). It's like how it took MySQL took a decade to get stored procedures and views despite many people asking for it. Many people complain about the late static binding issue but last I knew it was still "it's a feature, not a bug."

      And it's fixed in PHP6. So much for the decade.

    9. Re:As a PHP user.... by Splab · · Score: 1

      So you are saying segmentation fault is an accepted way of halting a program?

      I would say segmentation faults are a big nono.

    10. Re:As a PHP user.... by shutdown+-p+now · · Score: 1

      Precisely my point. The guy I replied to apparently disagrees with you and me, though.

    11. Re:As a PHP user.... by bad-badtz-maru · · Score: 1


      I saw identical behavior when a script tried to create an array that was too large.

    12. Re:As a PHP user.... by Splab · · Score: 1

      Doh, my bad.

      His comment was not shown because of low score :D

    13. Re:As a PHP user.... by Splab · · Score: 1

      So how do you propose to walk through a huge tree without recursion?

  18. Re:Question from a .NET developer trying to go OSS by Shados · · Score: 4, Insightful

    Yeah, with Java becoming open source, its right in line for you. Learning Java as a C# programmer is a joke, the basics are 95% the same, especialy if you use java faces (though I'm a bit "meh" about that).

    You pull java with eclipse, apache, strut/spring/hibernate/junit, then pull any database that hibernate supports, and you're in business.

    There's a learning curve, but you won't feel like anything is missing from .NET, really (I'm primarly a C# programmer myself, so I know where you're coming from). Unless you had a MSDN Universal license with Visual Studio Team Foundation, or were already using .NET 3.0 (Workflow, Communication, etc), this might actualy give you a lot more power than what you are used to.

  19. Re:Lemme guess... MySQL is also the best database? by eln · · Score: 5, Insightful

    Yes, bad developers produce insecure code, but let me take you on a brief trip down memory lane.

    Way back when, when the Web was new, and CGI was just starting out, there was some debate as to whether C or Perl should be the language of choice for writing CGI scripts. In the end, Perl became much more widely used because it was just too damn easy to open up major security holes writing in C, because it lacked some of the features of Perl (like making it impossible to commit a buffer overrun, for example). Perl won out in early CGI precisely because a lot of the problems of CGI security were already solved because of inherent features of the language.

    Now, PHP came along and billed itself (and in fact was designed) as an easy way to make secure web scripts. So, if the PHP code has bugs that impact its security in web-based applications, these things should be addressed. Otherwise, it's going to end up being supplanted by another language that is more secure and easier to use to build web apps.

    Blaming the developer for security is only going to take you so far when the language the developer is using is supposed to be SPECIFICALLY DESIGNED for web applications.

  20. Hmm... by Almahtar · · Score: 1

    I'd love to justify your arguments by actually addressing them, but they just don't deserve it. Instead I'll just say that you, sir, are an idiot.

  21. he just left a mailing list... by aaronwormus · · Score: 4, Informative

    The "news" is that Stefan Esser unsubscribed from the security@php.net mailing list.

    Stefan Esser will continue to work on PHP security through maintaining the Hardened PHP project [1] which is a patchset to PHP which enables some low level security features into the language, as well as the suhosin extension [2] for PHP which can be used without patching PHP and "protects servers and users from known and unknown flaws in PHP applications and the PHP core".

    I am personally of the "full disclosure" security mindset, so if there was indeed an issue with the response time of the "PHP Security Response Team" then some outside pressure would be a good thing.

    More about this on Zeev's blog [3].

    [1] http://www.hardened-php.net/
    [2] http://www.hardened-php.net/suhosin.127.html
    [3] http://www.suraski.net/blog/index.php?/archives/15 -Stefan-Esser-quits-securityphp.net.html

    1. Re:he just left a mailing list... by LizardKing · · Score: 1

      The "news" is that Stefan Esser unsubscribed from the security@php.net mailing list.

      That may be how Suraski is describing it, but if you read you'll find a slightly different story.

    2. Re:he just left a mailing list... by onosendai · · Score: 1
      From your reference (my emphasis)

      "it appears he'll now attempt to become even more aggressive, do his best to ignore the best interests of PHP by disclosing unpatched holes, and in general trying to expose as many security holes in PHP."


      How can anyone possibly think that disclosing and exposing security holes in an open source project is a bad thing and against the best interests of the language ?

      PHP is essentially the lingua franca of web development but the rise of Rails and Django simply highlight that it's time in the sun is coming to an end and if they have any chance of staying up with the jones', PHP's well known security issues need to be lain bare and plugged.
      --
      <? include ('signature.inc'); ?>
    3. Re:he just left a mailing list... by Anonymous Coward · · Score: 0

      Some replies have suggested this is a futile effort for php, because it is too far gone already, but it seems worth a try to me.

      So, being both cautious and lazy, has anyone here already tried Hardened-PHP or suhosin? Any problems/quirks applying/adapting it to known php applications? Feedback on other people's experiences would be appreciated.

  22. Re:Question from a .NET developer trying to go OSS by jrockway · · Score: 3, Interesting
    Another, more recent sollution [sic] would be Ruby on Rails, which has some realy niffty [sic] features.


    Rails is pretty cute. An more functional (but less "shiny") alternative is Catalyst. It's written in Perl, which means you get the benefit of over 10,000 extension libraries from the CPAN to draw upon. Perl also has some nice features that Ruby or PHP lack, like full native unicode support and automatic taint checking. It's also faster, because it's had 10 years to mature. Sadly people seem to be ignoring Perl these days, but with recent improvements it's nearly as cool as Ruby (check out "Moose").

    Also, if you'd like to access a database with compound primary keys, ActiveRecord won't support that, but Catalyst's ORM (DBIx::Class) supports it fine.

    Rails is good for quick apps like a wiki or a blog, but for more complicated internal applications, Catalyst is where it's at. Stop by the website, check out our advent calendar, or perhaps try the tutorial. Join us in #catalyst on irc.perl.org if you have any questions!
    --
    My other car is first.
  23. LOL Hardened PHP by Anonymous Coward · · Score: 0

    Developed by the guy who came up with the phrase "We had to burn the village in order to save it"?

    1. Re:LOL Hardened PHP by cortana · · Score: 1

      Apply the metaphor to PHP and I will agree with it wholeheartedly.

  24. Love the 'inexperienced programmers' excuse.. by cheros · · Score: 4, Insightful

    Wow, stunningly insightful response "that's caused by inexperienced programmers". He's a clue: it doesn't matter what the origin of the problem is (other than to fix it longterm) - IT STILL NEEDS ADDRESSING. I got news for you: the concept of covering large security related cracks in code with prime bullshit is probably already patented by Microsoft.

    Personally I would wonder if Essers' 'abrasive style' is not a result rather than a reason for not being listened to and if this flags up a major problem in the way PHP is coded and maintained I'm all for this move. There is no excuse for sloppiness.

    So, the reaction discloses the attitude - seems Esser made the right move..

    --
    Insert .sig here. Send no money now. Owner may sue, contents will settle. Batteries not included.
    1. Re:Love the 'inexperienced programmers' excuse.. by KidSock · · Score: 1

      Wow, stunningly insightful response "that's caused by inexperienced programmers".

      I think you misunderstood. He's not talking about the developers of PHP the interpreter. He's talking about developers of PHP applications. Inexperienced programmers are more likely to do stupid things like not escape their field values resulting in cross site scripting vulnerabilities. There's nothing PHP can do internally to prevent that.

      My understanding is that if written correctly PHP is very secure. The code is very mature and used all over the Internet. For an Internet site it would be very hard to convince me that another language would be inherently more secure.

      It's very unfortunate that this article was posted the way it was (as usual for /.) because developers will now remember this and think they might better off with another scripting language when in fact they can do stupid things just as easily with ASP as they can with PHP.

    2. Re:Love the 'inexperienced programmers' excuse.. by Anonymous Coward · · Score: 1, Insightful
      My understanding is that if written correctly PHP is very secure.
      If written correctly, any Turing-complete language is very secure. The issue is not whether it's possible to write secure code but the ease of doing so. Some of the most prominent PHP-based web applications have a parade of exploits that make Micros~1 look like the OpenBSD folks. These are not (one would hope) n00b programmers writing these applications. The conclusion to be drawn from that is that PHP doesn't facilitate secure apps or even make it reasonably easy to write secure apps.

      Contrast PHP database access with JDBC database access. Even the most clueless Java programmer can use a PreparedStatement to shield himself or herself from any possibility of a SQL-injection vulnerability by simply passing in data from the end-user as parameters. I believe Rails and other languages have something similar. This is a case where the language (or framework) facilitates good practices on the part of the programmer. Can I as a programmer write code that has a SQL-injection vulnerability in Java? Definitely. But I have to try to do something beyond the simple use cases that comprises 90% of the database access.

      PHP is full of things like this which make it easy for application developers to write bad code.
    3. Re:Love the 'inexperienced programmers' excuse.. by cheros · · Score: 1

      developers will now remember this and think they might better off with another scripting language when in fact they can do stupid things just as easily with ASP as they can with PHP

      Now THAT is absolutely correct. Actually, I'd be hesitant in case of ASP because that forces an underlying platform that needs a lot more attention to be reasonably Internet proof, but I digress :-).

      I very much recognise the guy's pain - I've been there myself often enough..

      --
      Insert .sig here. Send no money now. Owner may sue, contents will settle. Batteries not included.
  25. Not up-to-date on PHP security . . . by pembo13 · · Score: 3, Interesting

    can someone explain how it is that the apperently consensus is that PHP is insecure by design, asside from just poor programming? Thank you.

    --
    "Thanks for all the money you paid to us. We've used it to buy off ISO among other things" -Microsoft
    1. Re:Not up-to-date on PHP security . . . by aaronwormus · · Score: 2, Interesting

      The "PHP Way" has always been to give the user sufficient power to shoot himself in the foot. The benefit is that the language itself is not slowed down by "features" which exists only to keep stupid programmers from hurting themselves. There are projects (like hardened php and suhosin) which add these security features to the language itself. There have also been "features" such as register_globals, the Get/Post/Cookie quoting and safe_mode which were prone to attack when not used correctly.

    2. Re:Not up-to-date on PHP security . . . by nicklott · · Score: 1, Offtopic

      They, can't, they're all just curmudgeonly, aging perl hippies, bitter and twisted cos the web left them behind around the time of HTML 3.2. Viva la Revolution!

    3. Re:Not up-to-date on PHP security . . . by imroy · · Score: 1

      I know you're only joking, but you might be surprised to see what the 'perl hippies' are working on now.

    4. Re:Not up-to-date on PHP security . . . by gbjbaanb · · Score: 4, Insightful

      One of the biggest 'problems' is the way PHP is generally executed as an apache module. You get a lot of shared webhosts that run php as a module, and so the apache user runs the code. Fine, except that if you want to give your PHP script access to your data, you're effectively giving it access to everyone else's data too. So features like open_basedir were added to restrict this.

      Then there is features like safe_mode that turns off many system functions that an attacker could use to get round the other restrictions, and register_globals which is a feature designed to work around an inherently insecure system of passing variables to php pages.

      and so on, and so forth.. possibly the biggest problem is the ease of coding it, the barrier to entry is so low you will attract coders who (to be polite) don't know as much as they could about programming. So you get a lot of PHP code that is poor quality, makes too many assumptions on things that they should have tightened up (eg, not initialising variables to prevent an attacker from passing them in with their desired values), or checking input to functions from the form or url.

      Its the same issue as VB - it was so easy to code VB apps, my boss could do it. So he did. And they looked, performed and crashed as if a manager had coded them :(

    5. Re:Not up-to-date on PHP security . . . by dysfunct · · Score: 5, Informative
      I actually do a bunch of security consulting for PHP based stuff. A great deal of the issues stems from the very beginning of the PHP language itself. Being designed to be as easy as possible without regard to security has kind of made it the Microsoft of scripting langages. They have not built on insecure code, but rather entire concepts that are inherently insecure (fopen() wrappers that open nearly every data connection they're fed, register globals, SQL string concatenation) and have even for a long time endorsed and taught users those concept.

      Instead of changing concepts midway through they have added security layers and APIs that need to be *explicitly* set - meaning that like Windows (was?) they have a policy of being open per default and having to be explicitly made secure, instead of closed by default and enabling only what you need.

      That's what I think Stefan Esser means when he says "safer from the inside". Many things in PHP are inherently flawed and can only be remedied through changes in concept and nothing else.

      Add to that stuff like $GLOBALS overwrite (more details here) that are/were essentially a WONTFIX. No wonder Essner is getting frustrated.

      --
      :/- spoon(_).
    6. Re:Not up-to-date on PHP security . . . by Jamu · · Score: 2, Insightful

      It's impossible to write secure code elegantly in PHP. PHP is an inflexible language in which security features have been added using various options and functions. Any secure PHP code is going to be overly-difficult to read, and this can lead to insecurity via coding errors.

      This inflexibility of the PHP code language is partially solved by the use of numerous extensions (There are gaps: For example, none of the extensions can parse HTML in a natural way). The more API functions and extensions required to code a webpage, the greater the risk is that'll you'll use a function that's insecure. PHP has about 50 extensions, each with their own set of functions. It's not unusual for hosting sites to disable extensions in the interests of security.

      By default, PHP is configured with insecure options enabled. This can sabotage otherwise secure PHP code. It only takes a server crash and a hasty re-installation of PHP to get those options back to default. It has 'gotcha's too.

      Essentially, security, is not a basic feature of PHP.

      --
      Who ordered that?
    7. Re:Not up-to-date on PHP security . . . by kestasjk · · Score: 5, Informative
      I've written lots of PHP code in my spare time, and have written an article on creating "rootkits" to covertly inject into PHP scripts (phpBB2 in particular), so I thought I'd chime in. This'll probably be a long post but hopefully it'll give people some things to look out for.

      Here are the most common security problems you run into in PHP:
      • magic_quotes: This adds slashes to all input so that you don't have to sanitize it before it gets inserted into SQL. The problem is that developers write their code with magic_quotes on, but don't realize that it's often turned off elsewhere, which leads to gaping holes.
      • register_globals: Variables can be placed directly into the global namespace. If you don't explicitly set all variables before using them anything can be injected into them, which brings me on to:
      • Only critical errors are reported: If you use a variable which isn't set it'll just return null, with no error (unless you specifically turn up the error_reporting level). This means that someone who isn't familiar with the problem won't know that a variable in their script can be written to by anyone until it's being exploited, functions which you would expect to return an error and halt the script if they fail can carry on without giving any indication of failure.
      • fopen_urls: By default you can include scripts hosted on other websites! This often makes remote PHP execution, which would otherwise require eval(), much easier.
        Who would have thought "<?php include($var.'/include.php'); ?>" will run any PHP on any server, anyhere? (The attack in the article above leveraged entry using this, coupled with register_globals.)
      • Inconsistencies: What one function does can never be applied to what another function does; you can never assume anything with the PHP library and always have to keep a browser window with the PHP manual handy. Using a function without carefully reading up what it does, even when it's very similar to another function you're familiar with, is asking for trouble in PHP.
        The same goes for just about everything; are you checking whether some input equals some harmless number before passing it on to a SQL query or the browser? Don't forget that (5 == "5 UNION SELECT secret FROM ..."), null == 0 == "" == false, "a" == 4 == true; generally you just have to be on your toes.
      • Input checking is difficult: Do you want htmlentities() or htmlspecialchars() ? Have you remembered to strip_slashes() if magic_quotes is on? Remember the user can input arrays too, are you checking that the input isn't an array? Have you remembered to escape queries with mysql_real_escape_string() ? mysql_escape_string() doesn't account for the character set being used, and so isn't good enough, trying to escape input for yourself is also dangerous. What about null bytes? Remember that the user can input binary data; PHP allows null bytes, and will add a slash to them, but when you send a string with null bytes to some functions, but not others, the null bytes will be silently dropped leaving only slashes.
        To check input in PHP you have to be absolutely rigorous and take no half measures, people who aren't aware of the dangers don't stand a chance.

      To be honest I'm a big fan of PHP, it's very flexible and lets you develop very quickly and easily; if you have the knowledge and self discipline it's an excellent language. But allowing fast, easy development at the cost of security is insane for a server-side web scripting language!
      I was hoping that PHP6 was all about doing a 180 degree turn on security, but this article doesn't bode well..
      --
      // MD_Update(&m,buf,j);
    8. Re:Not up-to-date on PHP security . . . by kestasjk · · Score: 1

      Correction: When I said "a" == 4 == true I mean "a" == true, 4 == true, "a" != 4

      --
      // MD_Update(&m,buf,j);
    9. Re:Not up-to-date on PHP security . . . by vadim_t · · Score: 1

      Thank you, I will bookmark your post to give a link to it the next time somebody asks why I won't touch PHP with a 10 foot pole.

    10. Re:Not up-to-date on PHP security . . . by Anonymous Coward · · Score: 0
      "So you get a lot of PHP code that is poor quality, makes too many assumptions on things that they should have tightened up"


      No, no, no. If you have one language and 1 million coders. Make the language better. Humans all make mistakes and an inexperienced programmer is going to screw up all the time and a good one, once in a while. Well fix the hole in the language instead. And yes I know this could be hard, but sorry that is the way to go.



    11. Re:Not up-to-date on PHP security . . . by kestasjk · · Score: 1

      If you don't think you have the self discipline to allow yourself the flexibility of PHP without making mistakes then no, you shouldn't use it (this isn't an insult; some people prefer rigidity, some don't). There are lots of good languages out there that are more rigid and therefore harder to make mistakes with.

      However if you want the flexibility and rapid development times of PHP, and are a good coder who knows what he wants to do and how to do it, I'd fully recommend PHP.

      --
      // MD_Update(&m,buf,j);
    12. Re:Not up-to-date on PHP security . . . by XenoPhage · · Score: 1

      What you outlined is a pretty good list of potential issues, but any security conscious programmer should be checking for these anyways. I only seriously started programming in PHP last year, but I believe I've gotten up to speed pretty quickly. I started my own open source project (http://phptodo.sf.net/) and I've been endeavoring to improve it since.

      Yes, input validation is a difficult task, but I think it's just as difficult in other languages as well. And as for inconsistencies in the API, who really trusts that all functions act alike anyways? At the very least, you write the code the way you think it will work, then test the hell out of it. If you find something not acting right, you investigate. I always have the PHP manual handy when I'm coding. The tidbits of info in the comments alone are extremely valuable.

      I've become a big fan of PHP because of the speed in which I can build a simple application and the ease of putting it up on the web. That's not to say that I don't deal with the security side, but for internal applications I will put together a quick system to "get by" until I can improve it. The initial "out the door" bit is important when we're dealing with short deadlines.. :)

      Overall I'm pretty impressed with PHP. I'm still coding in the 4.x world, but even without the advanced OOP features I'm still having fun. :)

      --
      XenoPhage
      Technological Musings
    13. Re:Not up-to-date on PHP security . . . by vadim_t · · Score: 1

      I have flexibility without issues like that. I use Perl.

      Let's look at the issues:

      magic_quotes: Problem that doesn't exist in Perl. The way you do things is:
      my $sth = $dbh->prepare('SELECT foo FROM bar WHERE id = ?');
      $sth->execute($id);

      No manual quoting needed, no SQL injection issues. Perfect security. Notice the '' quoting, it prevents variables in strings from working.

      register_globals: CGI.pm allows importing parameters into the namespace you say. Documentation has dire warnings against importing into main. In Perl you'd have $Args::user_name, not $user_name (which could override something important and is obviously a braindead idea)

      Also, unlike PHP, Perl doesn't set such things system-wide, the script does. This way you can't really write a script that requires a specific configuration of the interpreter.

      Error reporting: Perl is sane about error reporting, and has taint checks that make the interpreter outright refuse to do something insecure, like opening a filename passed in a parameter unless verified.

      Inconsistencies: Perl also falls to the (5 == "5 SELECT...") trap, but emits a warning if you do that. Strings are compared with "eq" and not ==. You can get this wrong, but it's hard to miss.

      Input checking: In Perl it's easy. The language was made to parse text, and the DBI API makes a large amount of it unnecessary.

      Obviously, Perl has its failings as well. For example, it's very common to store large amounts of data in hash trees ($self->{settings}{rows_per_page}) which has the problem of that as they're not variables, declaration of hash elements can't be forced. But overall it's a much less braindead language than PHP and just as easy to write in.

    14. Re:Not up-to-date on PHP security . . . by Bogtha · · Score: 1

      The "PHP Way" has always been to give the user sufficient power to shoot himself in the foot. The benefit is that the language itself is not slowed down by "features" which exists only to keep stupid programmers from hurting themselves.

      On the contrary, the "PHP Way" has always been to give defaults where the user is likely to shoot himself in the foot, and when it inevitably happens, blame him for not changing the defaults (despite it breaking third-party applications). And the "benefit" you describe not only doesn't exist, it's the exact opposite of the truth - take "magic quotes" for example, where the language is slowed down by "features which exist only to keep stupid programmers from hurting themselves", and still manages to cause security headaches.

      Having seen the update to the story by Zeev, I have to disagree. There is a grey area between bugs in PHP and bugs in PHP applications, and this is one of the major problems of PHP - a design that, when used correctly isn't insecure, but also a design that makes it much more likely that it's used incorrectly. This is a problem caused by PHP itself, but the symptoms manifest themselves as problems with PHP applications, making it easy to pass the buck.

      --
      Bogtha Bogtha Bogtha
    15. Re:Not up-to-date on PHP security . . . by aaronwormus · · Score: 1

      What defaults in modern versions of PHP makes it likely for users to shoot themselves in the foot? You're right about magic_quotes, the question is what would happen if that weren't enabled?

    16. Re:Not up-to-date on PHP security . . . by Christianfreak · · Score: 1

      Yes, input validation is a difficult task, but I think it's just as difficult in other languages as well.

      In every other language I've ever programmed in, it was relatively easy to figure out where the variables came from. In PHP there's a chance that a configuration setting is going to have the ability to change that. I'm sorry but that's bad design.

      Who on earth thought that register_globals was a good idea? And why on earth do most of the popular third party apps still insist on using them???

      I've been using PHP for years, and I read all the stuff, yet I'm finding new problems with my own code just from reading some of the stuff in this thread. I think a switch to something better is long over due.

    17. Re:Not up-to-date on PHP security . . . by rho · · Score: 1

      I dunno, PHP can be as secure and elegant as anything else. Use DB interfaces such as ADODB rather than the language's low-level functions, use PEAR wherever possible, validate input. PHP's rapid development cycle means one person can do quite a lot, and sacrificing some security for simplicity is a fair trade off. Which is why there are so many PHP applications around. That's a net benefit IMO.

      --
      Potato chips are a by-yourself food.
    18. Re:Not up-to-date on PHP security . . . by mandelbr0t · · Score: 1

      Thanks for this link. It was getting really difficult to tell whether this security expert was expecting too much from the PHP project or not, but a bug of this nature is very telling. Any programmer, experienced or inexperienced, could run into this particular bug. Even code analysis by an experienced web programmer would fail to expose the vulnerability. It is irresponsible of the development team to refuse to fix this bug. I'm guessing that many of the other vulnerabilities that he found would also be gotchas for the most experienced of programmers. Shame on the PHP team for allowing someone of Esser's caliber to get away -- just another reason for me to use something else.

      mandelbr0t

      --
      "Please describe the scientific nature of the 'whammy'" - Agent Scully
    19. Re:Not up-to-date on PHP security . . . by shutdown+-p+now · · Score: 1

      You forgot the joy that is magic_quotes_gpc. In my opinion, the mere presence of that "feature" alone is reason enough to consider PHP to be broken by design.

    20. Re:Not up-to-date on PHP security . . . by 1110110001 · · Score: 1

      So how would you fix a function like "print". It shouldn't allow you to output invalid XML or HTML and prevent XSS, ... You can't. You could add a mandatory parameter, that defines how you want to use it. What would change? The inexperienced programmer would use an other language.

    21. Re:Not up-to-date on PHP security . . . by 1110110001 · · Score: 2, Informative
      Let's take a look at the "php.ini-recommended" (could be the name means you should use it).

      magic_quotes
      magic_quotes_gpc = Off
      magic_quotes_runtime = Off
      magic_quotes_sybase = Off
      register_globals
      register_globals = Off
      Only critical errors are reported
      error_reporting = E_ALL
      include($var.'/include.php');
      allow_url_include = Off

      The last one should get a fix in PHP 5.2.1 for data-URIs.

      Input checking is difficult: ... htmlentities() ... htmlspecialchars() ... strip_slashes()
      Which of these functions does input checking? None? Maybe http://php.net/ctype would help.
    22. Re:Not up-to-date on PHP security . . . by Anonymous Coward · · Score: 0
      Don't forget that (5 == "5 UNION SELECT secret FROM ..."), null == 0 == "" == false, "a" == 4 == true; generally you just have to be on your toes

      Yea... my favorite is: count(false) == true

    23. Re:Not up-to-date on PHP security . . . by XenoPhage · · Score: 1

      In every other language I've ever programmed in, it was relatively easy to figure out where the variables came from. In PHP there's a chance that a configuration setting is going to have the ability to change that. I'm sorry but that's bad design.

      Err.. Huh? I understand register globals and I know how dangerous it is. But I'm not quite sure about your other statement.. How could you not know where the variables come from? You are declaring them first, right? register_globals doesn't overwrite an existing variable, it will only create the variable if it does not exist..

      Right from the PHP manual : "Always validate your user data and initialize your variables!" Seems to be pretty sound advice to me...

      Who on earth thought that register_globals was a good idea? And why on earth do most of the popular third party apps still insist on using them???

      Agreed. register_globals, at the time, was probably created to make web apps easier to write. Remember, this was prior to security being a huge issue on the net. In retrospect, I'm sure many people, the developers included, think this was a bad move.

      As for why it's still used, I can't answer that. Personally, I do what I can to make sure it doesn't impact my code. I refuse to use it and refuse to run any software that requires it to be enabled.

      I've been using PHP for years, and I read all the stuff, yet I'm finding new problems with my own code just from reading some of the stuff in this thread. I think a switch to something better is long over due.

      To each his own. I like PHP. It's definitely not a C or a C++, but it's great for what it does... I prefer PHP for simple web programming, perl for server scripting, and C++ for heavy duty programming.

      --
      XenoPhage
      Technological Musings
    24. Re:Not up-to-date on PHP security . . . by AnyoneEB · · Score: 2, Informative
      Don't forget that (5 == "5 UNION SELECT secret FROM ..."), null == 0 == "" == false, "a" == 4 == true; generally you just have to be on your toes.

      Correct, the semantics of == are different in PHP than in most other C-like languages. The operator you are looking for is ===. As a further note, I usually explicitly cast values to int if expect them to be integers, so random strings just become zero.

      --
      Centralization breaks the internet.
  26. Re:Lemme guess... MySQL is also the best database? by Ckwop · · Score: 2, Insightful

    This reminds me a lot of the fundamental principle of politics:

    Never blame the voters.

    In software, people with their feet so I bet this principle applies equally to this field.

    Simon.

  27. PHP security is a disaster by design by Anonymous Coward · · Score: 2, Interesting
    Variables are untyped, so if you do $a + $b, it's not clear what the result might be. Variables do not have to be declared before use, so if I have code like:

    $authorized = callAuthFunction();
    if(! $authoorized) logoutUser(); // note the misspelling
    mysql_query("UPDATE account SET ...."); // you get the idea
    Woops! Languages that have a permissive syntax make it easy for bugs to hide. And security flaws are just a particular subset of bugs. At a higher level, we have problems such as widespread use of direct DB access all over the place, instead of some kind of persistence layer, which results in likely SQL mistakes, and even injection attacks if the code isn't using correct pear DB. There's no true filter mechanism in PHP. There's no way to annotate objects as requiring a certain user-in-role. The whole thing is a big mess of C code and third party libraries, and there are good old fashioned C buffer overflow vulnerabilities in those areas too. Wee!
    1. Re:PHP security is a disaster by design by Anonymous Coward · · Score: 0

      Your example has nothing to do with strong vs. manifest vs. no typing. It has to do with the insanely braindamaged idea of automatic variable creation. PHP is just chockfull of this kind of incompetent 1st-grade bullshit. It's the worlds only programming language designed by functional retards.

    2. Re:PHP security is a disaster by design by Anonymous Coward · · Score: 0

      Languages that have a permissive syntax make it easy for bugs to hide

      Which is why you should never use Perl, PHP or any similar language for anything really important, especially if it is a large and complex product the general public will have access to.

    3. Re:PHP security is a disaster by design by Anonymous Coward · · Score: 2, Insightful

      Absolutely correct. PHP makes it so easy to create incorrect code, with no warnings, that it should never be used for public web sites. To fix PHP, they would need to introduce strong typing and mandatory declaration of variables. And pages should require compilation. And the "include" statement should be gone, replaced by another statement that does linking. None of those things would be huge changes and even junior-level PHP programmers could quickly learn these new rules. These changes would invalidate all existing PHP code but in the process of bringing the code up to the new standard, many many serious bugs would be shaken out. And there would be huge side-benefits for syntax-checking and development tools. It's obvious that this is the right thing to do, but the PHP team just doesn't understand much about programming languages or even good web application development.

    4. Re:PHP security is a disaster by design by solidox · · Score: 1
      Variables are untyped, so if you do $a + $b, it's not clear what the result might be.

      There is a section of the manual which describes the behaviour to expect when types are mixed.
      See... Type juggling

      You should always be developing with error_reporting(E_ALL|E_STRICT);
      This would throw a Notice warning about the use of an undeclared variable when the code tries to access it.
      Error reporting should more than likely be disabled for your production enviroment however.

      (E_STRICT is PHP5, E_ALL on its own will still generate the Notice)
      --
    5. Re:PHP security is a disaster by design by Anonymous Coward · · Score: 0

      No, it is not the languages fault that you have no idea how to write code in it at all. If you had even taken the time to read the tutorial section of the PHP manual you would realize how retarded your comment is. A programmer has to be an incredibly big dumbass to spell the name of a variable wrong and expect their code to continue working. Further, PHP does have a database persistence layer (just because you're too dumb to use it doesn't mean there isn't one.) "The correct Pear DB" is not needed to prevent SQL injection, it would just seem that you're too lazy to read the PHP manual and use the built-in escaping functions like mysql_real_escape_string() or prepared statements. You say that there is "no true filter mechanism", apparently you haven't looked at the PHP manual page called "Filter Functions". PHP also provides a PECL extension called "filter".

      Further, every "vulnerability" you've described applies to every scripting language in existence. None of Perl, Ruby, Python, ASP, ColdFusion, or anything else are going to continue to work if you spell your variable names wrong (idiot), and none of them are going to be secure if you purposefully pass unsanitized user input to the database.

    6. Re:PHP security is a disaster by design by Anonymous Coward · · Score: 0

      The point is that the code still does work if you spell the variable name wrong, it simply works in an unintended fashion(giving everyone access) which might not be easy to notice. If I spell "authorised" as "authoorised" in C, I'll get a compiler error(unless I've actually got a variable named "authoorised", in which case the "idiot" label might really be appropriate).

    7. Re:PHP security is a disaster by design by Anonymous Coward · · Score: 0

      Actually you don't need mandatory declaration of variables. Ruby for instance warns you if a variable is used but unassigned - the assignment is the declaration. This would allow you to still catch typos without having to change anything in the current way PHP is done.

    8. Re:PHP security is a disaster by design by Christianfreak · · Score: 1

      and even injection attacks if the code isn't using correct pear DB

      PEAR DB is almost as bad. Statements aren't prepared at the database level (I guess they'd need a real C extension to do that?), its just a regex that replaces the placeholders as it finds them in a foreach() loop. (There are numerous problems with foreach() in PHP 4 as well)

      The placeholder syntax is wrong, they not only use ? as a placeholder but ! and something else as well (I can't remember what character). That breaks negation queries, instead of "SELECT foo FROM bar WHERE baz != 1" you have to do "SELECT foo FROM bar WHERE baz 1"

      When I wrote them about this issue, they said it was something to with what type of variable you sent (? for strings and ! for numbers) ... that makes little since because they don't enforce the strings vs. numbers in the codes, you can pass either one using either of the placeholder characters.

      There's also a bug when you send 0 as a placeholder. If a value is false it won't replace it, then you end up with a query error.

      All of this was enough for me to give up on PEAR DB about a year ago and I wrote my own db wrapper.

    9. Re:PHP security is a disaster by design by Anonymous Coward · · Score: 0

      Thank you sir for confirming the point I made about PHP programmers not even understanding security or why the language is so broken. My example shows a clear case where there is an easily-overlooked misspelling that lets the code keep on running and lets it do an insecure thing. Oh, and there are no filters in PHP. Filters exist in the Java Servlet spec where they are able to intercept the request. Nothing like that exists in PHP. And you say that every vulnerability I've described exists in every scripting language in existence. No, that's not correct. Perl has a strict mode which requires variables to be declared before use. But I would recommend using a non-scripting language like Java that has compilers and immutable types.

      Oh and you say I'm an idiot for spelling variable names wrong. That's one of those "I don't even know how to think about security" type of things. If you think you never spell a variable name wrong, then that only means that you are not aware of the bugs in your code. Everyone will eventually spell variable or method names wrong. Compilers are supposed to help us catch those things.

  28. Re:Lemme guess... MySQL is also the best database? by quantaman · · Score: 4, Insightful

    Any language is only as good as the programmer using it. I actually have a philosophy when writing applications that is almost the complete opposite of that.

    Anytime the tool does something that the user doesn't want it's a bug.

    This applies to applications, programming languages, heck even cars if you want.

    The fact is that if the user gets something they didn't want, no matter how stupidly they tried to use it, the tool still bears some of the blame. I don't care how dumb a thing the user did, there was something there that made them think they could do that and it's a bug.

    With programming languages if the language allows the user to create a security hole it's the fault of the language on some level. Sure you can get stupid programmers but blaming the programmer entirely discourages the search for a better language. Yeah if I overrun my array in C it's my fault. But can it be entirely my fault when in Java that same bug wouldn't be a security exploit? Hey, if I drive my car straight off a cliff, is that my fault? Yeah. But a car with a computer failsafe driver wouldn't of gone off the cliff (hey, if two jetliners are on a collision course the computer takes over).

    You can never make the perfect tool, even a big green button that will do everything you ever wanted will still have a bunch of people who didn't think to push the button. But it forces you to realize, you can never fix users but you can always fix your code.
    --
    I stole this Sig
  29. Re:Question from a .NET developer trying to go OSS by holy+zarquon's+singi · · Score: 1

    I second the bloke who mentioned Catalyst. In one sense it's a url path dispatcher, but it's pretty elegantly done with full debugging support. Sure it's perl, but many people think that's a plus.

    --
    "...we should just trust our president in every decision that he makes and we should just support that." B.Spears 2003
  30. Here's an eye-catcher by Beryllium+Sphere(tm) · · Score: 4, Insightful

    >bugs were sometimes not correctly fixed or were re-introduced. This was often not noticed because there was no test-rig for exploits and the idea of having one was categorically rejected.

    If that's accurate, and if there wasn't some unimaginable compelling reason, any security person would be unhappy.

  31. Re:Question from a .NET developer trying to go OSS by aztracker1 · · Score: 1

    I looked through some of the other mentions... though you won't find a plethora of hosting options, if you plan on a dedicated server, you may want to give apache2 + mod_mono2 a look... ASP.Net 2 goodness running on linux... the client libraries for mysql, firebird and postgres are pretty mature. You can develop on windows, and test/deploy on linux.

    If you are interested in something different, would do like others have suggested, and look at Ruby/Rails, Catalyst or Java JSP/J2EE. Java will be the closest to C#, but I'm not such a fan of JSP.

    --
    Michael J. Ryan - tracker1.info
  32. PHP ought to be forked by Jesus_666 · · Score: 4, Interesting

    Someone should fork PHP and do a major rewrite. Drop features like HTML embedding, introduce properly defined packages and make all functionality available in both procedural and OO fashions. Clean up the function names so they're predictable. And make some of the more dangerous functions safer.
    PHP could be turned into a decent general purpose scripting language if someone would fork it. Unfortunately that means that we'd need someone who knows the codebase, has time and is fed up with the current PHP development process. Maybe we could talk Esser into it...

    --
    USE HOT GRITS WITH STATUE OF NATALIE PORTMAN (NAKED AND PETRIFIED)
    1. Re:PHP ought to be forked by aaronwormus · · Score: 1
    2. Re:PHP ought to be forked by Anonymous Coward · · Score: 0

      I think the OP meant a proper fork. Not one whose only (it seems) approach is to remove all underscores and change the names to CamelCase.

    3. Re:PHP ought to be forked by I+Like+Pudding · · Score: 2, Informative

      PHP's niche in the web ecosystem is as "the stupid, easy to host scripting language". If you forked it like that, you'd basically have mod_perl, and everyone would still be using the original, awful PHP.

    4. Re:PHP ought to be forked by Jesus_666 · · Score: 1

      That's why I said "general purpose scripting language". I use PHP for shell scripting and it's pretty useful (you can crank out a decent script for just about anything in no time and if you know what you're doing it's no less safe than a Python or Perl script would be). However, I have to agree that PHP is egregiously designed, from the inconsistent way of doing just about anything to the fact that even shell scripts invoking PHP via #! require the tags.

      A sanitized (in the meaning of "made more sane") PHP offshot would be more useful in shell scripting as one doesn't have to spend as much time in the (thankfully excellent) documentation and it could easily be used for web scripting - in fact I'd consider it superior as in most cases there are no gains from using inline PHP.

      If people complain that using templates is too hard, include a demo page that shows how to use the sanitized versions of get_file_contents(), str_replace() and echo to work with templates - really, PHP makes working with templates really easy; there's no excuse for not promoting them as the standard - or even only - way of handling HTML output. The less jumbled PHTML the world sees the better.

      --
      USE HOT GRITS WITH STATUE OF NATALIE PORTMAN (NAKED AND PETRIFIED)
    5. Re:PHP ought to be forked by asuffield · · Score: 1

      Why would you go to all that effort just to recreate perl?

    6. Re:PHP ought to be forked by I+Like+Pudding · · Score: 1

      I don't think PHP merits being put on the command line, even if it were cleaned up. Instead of mod_perl, you'd just have a grotty Perl dialect without CPAN and, really, Perl itself is already deprecated. I only use it at work because I have to. All my personal projects are done in Ruby or Haskell. I'd probably be using Python, too, if the users I routinely run into on the net weren't such zealots.

    7. Re:PHP ought to be forked by This+Is+Ridiculous · · Score: 1

      Someone should fork PHP and do a major rewrite. Drop features like HTML embedding, introduce properly defined packages and make all functionality available in both procedural and OO fashions. Clean up the function names so they're predictable. And make some of the more dangerous functions safer. That's like saying someone should make a pizza, only without the crust, cheese, sauce, and toppings.
      --
      Hey, you try to find an open nick these days!
    8. Re:PHP ought to be forked by Anonymous Coward · · Score: 0

      "even if it were cleaned up. Instead of mod_perl, you'd just have a grotty Perl dialect"

      Other than its human readable.

      I've used a number of PHP scripts myself where I had to rewrite someone elses Perl scripts -- and this is on Windows.

      It may be a perl dialect, but its a hell of a lot more verbose and makes a lot more sense when you are trying to maintain it -- I don't know about you, but I haven't met even a well commented perl script that I knew what the fuck it did. PHP -- any idiot can read it and tell you.

      That might be the biggest difference. Its written for PEOPLE not nerds. And why is PHP full of security holes? Because PEOPLE can write it...give the average person access to anything, he'll find a way to create a hole. Give a nerd PHP and he'll find a way to secure it.

    9. Re:PHP ought to be forked by I+Like+Pudding · · Score: 1

      I maintain a 35KLOC+ mod_perl web app. Not including the templates. It manages to be more readable than a great deal of the PHP I've come into contact with. I really don't think readability is a strong point for either language, anyhow. Perl's reference semantics are ass, and PHP lends itself to not separating the view from the controller.

    10. Re:PHP ought to be forked by Anonymous Coward · · Score: 0

      > PHP could be turned into a decent general purpose scripting language

      Sorry, but you're an idiot!

      PHP cannot be a general purpose scripting language because it is intended to run within a web server. If you turn PHP into a generic script language, all the advantages of PHP are lost, you must implement a real garbage collector, support threads, and you cannot rely on the fact that a script runs for less than 30 seconds.

      There are several good script langages, Scheme for example or Python or Ruby. The crude PHP syntax cannot compete with these.

    11. Re:PHP ought to be forked by Anonymous Coward · · Score: 0

      No kidding, just use Perl.

    12. Re:PHP ought to be forked by Jesus_666 · · Score: 1

      Sorry, but so are you! (Yeah, I know, IHBT, but whatever...)

      Ruby cannot be used for dynamic websites because it's meant to be run on the command line. There's no way ever that a language can support both a CGI and a CLI, especially PHP, which has backends for Apache, generic CGI and a CLI. Nuh-uh. *sticks fingers in ears* LA LA LA!

      And you're so damn right about a PHP fork needing completely new memory management - after all it'd have to do something PHP already does quite well. The need for a new garbage collector obviously follows. And the fork would lose all the advantages of PHP like dynamic typing, easy array management and a rich set of built-in functionality because, er, space pirates would steal it.
      And yeah, multithreading is a real issue, because we all know that it's impossible to write a quick shell script without relying on dozens of threads. And we also know that nobody could ever add such functionality to a language, just like nobody would ever think of removing PHP's execution time limit when forking it.

      By the way, why Python, Ruby or Perl? We already have LISP. There's no reason whatsoever to write a new language that follows a different approach when there already is a language that is roughly functionally equivalent! Also, the crude P* syntaxes can't compete with the power of LISP.


      This post has been brought to you by the letters S, A, R, C, A, S and M.

      --
      USE HOT GRITS WITH STATUE OF NATALIE PORTMAN (NAKED AND PETRIFIED)
    13. Re:PHP ought to be forked by GamblerZG · · Score: 1

      Sorry, but IMO it's impossible. It's simpler to make Ruby easy to install and work with than to rewrite a language designed by a committee. PHP is popular because it's popular, not because it's a good language. Nobody will use the "updated" version, because it will be another language, which is not popular.

    14. Re:PHP ought to be forked by DragonWriter · · Score: 1

      Eh, HTML embedding is what PHP is largely about (its a recursive acronym for "PHP Hypertext Preprocessor"), and a lot of the warts are related to its fundamental purpose: being an easy to use HTML-embedded scripting language.

      Yeah, you could fork PHP drop a lot of the central ideas, and build a decent general purpose scripting language, but there are already plenty of good general purpose scripting languages that don't have the disadvantage of baggage from design for a radically different purpose. Other than challenge and satisfaction of having done it (which I'm sure would make the project attractive to some people), what's the point?

    15. Re:PHP ought to be forked by Anonymous Coward · · Score: 0

      Umm... Wouldn't that be Perl?

    16. Re:PHP ought to be forked by Anonymous Coward · · Score: 0
      Perl itself is already deprecated.

      Don't be silly.
    17. Re:PHP ought to be forked by Jesus_666 · · Score: 1

      I know that taking away HTML embedding would mean taking away PHP's foundation, but hey, it's not like nothing good has ever come from misappropriation.

      As for the point... The point is that I rather like PHP and being able to quickly produce working code. PHP has the same advantage Java has: A large standard library that allow it to do everything from string manipulation to SQL to PDF generation.
      I just happen to like working with PHP and I happen to hate what embedded PHP can do to HTML code. Sure, it defeats the purpose PHP was built for, but there are much cleaner ways of using PHP to dynamically generate web sites. Maybe one could even add a processTemplate($path, $variables) function that is essentially equivalent to strtr(file_get_contents($path), $variables) - a shorthand like that (preferably with added error checking) might turn off people less than "building a simple template engine is trivial, so do it yourself".

      --
      USE HOT GRITS WITH STATUE OF NATALIE PORTMAN (NAKED AND PETRIFIED)
    18. Re:PHP ought to be forked by DragonWriter · · Score: 1
      The point is that I rather like PHP and being able to quickly produce working code. PHP has the same advantage Java has: A large standard library that allow it to do everything from string manipulation to SQL to PDF generation.


      But, again, one of your main complaints is the inconsistency in the standard library. So is it really better to fork and remake PHP when compared to, say, just taking Python, which has a similar kitchen-sink approach, perhaps misses some features that the PHP standard library has in its standard distribution, but has readily available, open-source modules covering very similar scope (perhaps wider, even) than are available for PHP? I mean, is redesigning PHP really a better approach then (for example) simply rolling available free Python modules into a bigger distribution? Is PHP, at its core, a better scripting language than Python (or insert another widely-supported scripting language, if you prefer)?
    19. Re:PHP ought to be forked by chromatic · · Score: 1
      PHP has the same advantage Java has: A large standard library...

      Now that's a use of the phrase standard library which I never expected to hear!

    20. Re:PHP ought to be forked by Anonymous Coward · · Score: 0

      PHP-GTK kinda demonstrates that PHP is much more then a web language.

    21. Re:PHP ought to be forked by Jesus_666 · · Score: 1

      Well, PHP exists and I like it better than Python, even with the screwy standard library - for example, it doesn't try to impose a certain philosophy on its users. PHP puts ease of use over purity of philosophy, which is why it has this grown feel to it; functionality was added when deemed neccessary. Much of what the rewrite would do (and what ogoproject.com tries to do) would be the creation and application of consistent function signature standards, which alone would make the language more accessible.

      The idea is to generate a language that feels like PHP but lacks some of its more problematic features and flaws. Just using a different language wouldn't recreate the feel and rewriting a different language to feel like PHP would probably be much more work than rewriting PHP to do some things differently.

      --
      USE HOT GRITS WITH STATUE OF NATALIE PORTMAN (NAKED AND PETRIFIED)
    22. Re:PHP ought to be forked by Jesus_666 · · Score: 1

      It's a library of functions that are considered the standard functions of every PHP install (even though a good chunk of them can be turned off at compile-time). That the library does not follow any standards only means that it's a pretty standard-less standard library.

      Note to self: Talk PHP developers into calling the set of functions that come with PHP the "nonstandard library".

      --
      USE HOT GRITS WITH STATUE OF NATALIE PORTMAN (NAKED AND PETRIFIED)
    23. Re:PHP ought to be forked by Anonymous Coward · · Score: 0

      The sum and summary of ogo's grand and bold ideas for PHP are to clean up the functin names. Wow. One wonders if they have anyone there who even knows the Zend engine or even the parser, let alone having any skill in language design or actual clear vision of a better PHP.

  33. Zend guy has a good point by pikkumyy · · Score: 1

    Just because the language is easy is no reason to (attempt) to make it idiot proof. Numerous crappy 'security features' have already been added to the annoyance of decent programmers. Making it more secure by design would only encourage sloppy programming, which already is a big problem.

  34. Let me guess ... by Anonymous Coward · · Score: 0

    "PHP Security Expert Resigns, cites own incompetence as reason".

    1. Re:Let me guess ... by Anonymous Coward · · Score: 0

      check out his blog. he doesn't seem that incompetent to me. he has created a patch set for php to harden it.

  35. MOD PARENT UP by DoktorTomoe · · Score: 1

    Those are the times I wish I'd knew more C/C++ to support such a fork.

    So long, I am currently switching most of my PHP projects to python (which is a PITA if you are used to php's mysql-handling and regexp-support..., but a major step towards a more reliable webserver enviroment). Unfortunately, clients tend to persist on PHP ("Build it, we'll find a 15-year-old scriptkiddy to do the support and extensions...")

    1. Re:MOD PARENT UP by gbjbaanb · · Score: 2, Interesting

      perhaps a better idea than forking PHP would be to add these desirable sections to python instead.

      Then a php to python coverter, and then we could start to forget about magic_quotes and safe mode.

    2. Re:MOD PARENT UP by Jesus_666 · · Score: 1

      Unfortunately, Python and PHP have vastly different principles behind them and Python isn't everyone's cup of tea. If one would change Python to include those things most liked about PHP the result wouldn't be anything near what Python is supposed to be.

      --
      USE HOT GRITS WITH STATUE OF NATALIE PORTMAN (NAKED AND PETRIFIED)
  36. Re:Lemme guess... MySQL is also the best database? by trochej · · Score: 1

    > Hey, if I drive my car straight off a cliff, is that my fault? Yeah. But a car with a computer failsafe driver wouldn't of gone off the cliff (hey, if > two jetliners are on a collision course the computer takes over). Hey, if I hit my thumb with a hammer by mistake, would it be my fault?Yeah. But a hammer with computer failsafe hammer-operator would avoid hitting my thumb, right?

  37. Re:Question from a .NET developer trying to go OSS by klagg · · Score: 1

    That depends (of course). Ruby on Rails is very nice, but the Ruby language is very different from C#. PHP is much more similar.
    If you decide to go with PHP, have a look at the Symfony project. It's a well-documented rails-like framework for PHP, it really promotes better coding practices.

    --
    Free GPL Java Mobile Tetris game: Jamos
  38. Re:Question from a .NET developer trying to go OSS by kahei · · Score: 1


    Moving from C#/ASP.NET (and presumably SQL Server) to PHP/MySQL is like chopping your hands off. You can do much better than that.

    DB-wise, PostgreSQL is as powerful as SQL Server in most ways, and more powerful in many.

    Language-wise, you have Python, Ruby, Java and even Perl. Perl is baroque and dated and I'm not sure I could recommend using it now. Java brings with it the whole Java stack and accompanying XML hell and performance issues (yeah, I know, they don't really exist and it's all a conspiracy). Ruby and Python are fairly different languages -- Ruby is more fun while Python is more powerful and better-supported.

    But to be honest, there is absolutely no reason why you should leave C# at all if that's your preferred environment (and it's certainly at least as useful a skill as any of the above). Mono is pretty darn solid and it's possible to write web components with it that are 99% (maybe 100%, I dunno, but I seem to recall I found some minor issues) compatible across windows and Linux.

    My choice would probably be a Python environment backed with PostgreSQL. As it happens, I use PHP and MySQL just for the sake of keeping au fait with the 'less robust' end of the market -- if that's not an issue I don't see why you should use them. After C#, PHP is a pretty bitter pill to swallow.

    --
    Whence? Hence. Whither? Thither.
  39. Shenanigans! by kahei · · Score: 4, Funny

    Now, PHP came along and billed itself (and in fact was designed)

    I call shenanigans! No way was PHP 'designed'!

    --
    Whence? Hence. Whither? Thither.
    1. Re:Shenanigans! by Anonymous Coward · · Score: 0
      Sorry dudes to all that didn't get to see her. I decided to take the pictures down. I did promise her that I wouldn't put them up on the internet. And now that the booze is wearing off, my sense of responsibility is coming back. Just say she basically looked almost the spitting image of the Asian chick that Wolverine fought in the first X-Men.

      Oh...except that I fucked her. Good times, men. Good times.

    2. Re:Shenanigans! by jjn1056 · · Score: 1

      Didn't he fight her in the second movie? I didn't care for the first one too much, but I saw the second one 3 or 4 times, mostly because I enjoyed the fantasy of mutants chasing president bush through the white house.

      Glad to hear you got laid over the weekend.

      --
      Peace, or Not?
  40. In related news by MosesJones · · Score: 4, Insightful

    Law makers in Texas are debating a bill to enable people to own nuclear weapons and heavy artillery and to remove safety catches from guns.

    "All you should need is a great big red button that says 'Fire'" said Congressman Bobby Ewing "Its ridiculous that people are prevented from using these things and having to put up with safety devices it just encourages sloppying thinking"

    "By letting people launch nuclear weapons with a big red button we are making sure that everyone is aware of how to properly care for their nuclear weapon and that it is their god given right and responsibility to fire it carefully" said some bloke in a hat "I'm fed up with all the ridiculous procedures I have to go through to fire a gun, let alone blow up France just because a few bleeding heart liberals feel they need to protect stupid people in New Hampshire"

    In related new Iowa has banned the use of indicators, roll cages, air bags, crumple zones and seatbelts as it gives people too much sense of security. California has banned the use of door and window locks and the use of burglar alarms as they make houses "secure by design".

    Secure by design is the only type of security that really counts.

    --
    An Eye for an Eye will make the whole world blind - Gandhi
    1. Re:In related news by joe+155 · · Score: 1

      "In related new[s] Iowa has banned the use of indicators, roll cages, air bags, crumple zones and seatbelts as it gives people too much sense of security. California has banned the use of door and window locks and the use of burglar alarms as they make houses "secure by design"."

      God I wish that this sort of thinking (which I know you put up as a joke/to prove a point) never happened in the real world, but there is evidence that seat-belts have increased the number of deaths to certain groups and not done too much to reduce other deaths. The idiots actually drive less safely because they are wearing a seat-belt...

      If you want to look more in depth see http://en.wikipedia.org/wiki/Seat_belt_legislation #The_British_Law , it has a link to the original report

      --
      *''I can't believe it's not a hyperlink.''
    2. Re:In related news by pikkumyy · · Score: 1

      +5 Insightful?

      Yes, I can see how it is insightful to compare a programming language with nuclear weapons.

      Oh wait..

  41. No bad dogs, only bad owners by ajs318 · · Score: 2, Informative

    A bad worker blames their tools and a bad boss blames their workers.

    There's no denying that PHP has things wrong with it. It started out as a bastard son of Perl, tried to be a bit more n00b-friendly and tripped over its own cleverness. The beauty of Perl is its very inconsistency. The functions you use most have the shortest names, and there is no need to clutter things up with unnecessary brackets around arguments. Regular expressions, which you are going to use all the time, have a distinct syntax. Number and string data types can be interchanged with such wild abandon, there have to be separate operators for addition and string concatenation (JavaScript, I'm looking at you). There are constructs to populate arrays quickly. All things are subordinate to the goal of letting a programmer get a job done. Easy things are easy, hard things are possible. Perl is so broad-minded, it even has the Principle of Equivalence built in!

    PHP lures you in, with obviously_named_function($par1, $par2) ..... then trips you up with anotherobviouslynamedfunction($par2, $par1). You could say it's not all PHP's fault, as the functions originate from different shared libraries, and PHP is only providing an interface to them by their original name and with something like their original syntax. But it still smacks of laziness on the PHP developers' part. Short aliases for commonly-used functions (a context-sensitive editor can always expand them for the benefit of the anal retentive), and differently-named work-alikes for functions that take their parameters in a different order than you might expect, wouldn't have hurt. Would they?

    Still, you've got two choices, I suppose. Learn to put up with the idiosyncracies or learn another language. And never forget the Principle of Equivalence; "All Means to the same End are equally valid", nor its corollary, "Means which are not equally valid serve different Ends".

    --
    Je fume. Tu fumes. Nous fûmes!
    1. Re:No bad dogs, only bad owners by maxume · · Score: 1

      Stretching your analogy a bit, sometimes it's easier to shoot the old dog and get a new one than it is to fix the old dog.

      --
      Nerd rage is the funniest rage.
    2. Re:No bad dogs, only bad owners by SimHacker · · Score: 1

      Absolutely right. The effort required to "fix" PHP is gargantuan (and futile) compared to the effort of simply learning a better language that doesn't need to be "fixed". It's ridiculous to put any more effort into PHP, when so many excellent alternatives are immediately available.

      Monolinguistic newbie PHP apologists: There is nothing "special" about PHP. The feeling of power it gives you is from the COMPUTER, not the language. Every other programming language gives you the EXACT same feeling of power. PHP is not any easier to learn than most other modern languages, in fact it's much harder to learn to deal with all of its nuances, quirks, bugs, limitations, and work around all of its design flaws, which you don't have to worry about with better languages like Ruby and Python, which are both extremely easy to learn and use. PHP's simplicity is an ILLUSION, and its flaws are a FACT.

      Case in point: Ruby's ActiveRecord and Python's SQLAlchemy make it MUCH EASIER and also MUCH SAFER to access SQL databases, than anything PHP has. And that's not because nobody's bothered to write a decent ORM in PHP: they have, and they failed miserably. If you think you can do a better job than Zend's ZActiveRecord Boondoggle, then go ahead and try, but even the charlitans who DESIGNED PHP were so overconfident in its abilities and broadsided by its limitations and design flaws that they didn't even understand themselves before they tried and failed.

      -Don

      --
      Take a look and feel free: http://www.PieMenu.com
  42. If he returns to the PHP after discussions by maroberts · · Score: 3, Funny

    Would a suitable headline be "Goaded, Esser Back"?

    Apologies to Douglas R. Hofstadter

    --

    Donte Alistair Anderson Roberts - hi son!
    Karma: Chameleon

    1. Re:If he returns to the PHP after discussions by Anonymous Coward · · Score: 0

      Awesome.

  43. Re:Question from a .NET developer trying to go OSS by Tim+C · · Score: 1

    Learning Java as a C# programmer is a joke, the basics are 95% the same

    I'll second that having come from the other direction - I'm a professional Java programmer and sometime hobbiest C# programmer. While I certainly wouldn't claim to be an expert and I've not done anything I'd consider particularly complicated (a couple of fairly noddy webapps and a couple of basic D3D things), C# was incredibly easy to pick up.

  44. Re:Question from a .NET developer trying to go OSS by This+Is+Ridiculous · · Score: 1

    I'm currently writing an app with Catalyst. ("Currently" as in "paused to look something up while working on it and spotted this story".) It's based on Perl and usually combined with Template Toolkit, which uses a mini-language to describe templates. I definitely recommend it—it's about the cleanest way I've found to create a dynamic site.

    Catalyst is designed to keep the different parts of your app separate from each other, unlike PHP which tends to encourage mixing presentation code with application logic. (You can write PHP apps nearly as cleanly as Catalyst apps, but Catalyst helps you do it while PHP makes it fairly inconvenient.) It basically carves your site into three big chunks—Model, which talks to the database; View, which talks to the web browser; and Controller, which bridges the other two. Typically you'll need a model for each database, a controller for each section of the site, and a view for each method used to access the site (HTML, RSS, web service, PDF...). Models are usually auto-generated, and the glue code for the views is written for you, so you basically just have to write your templates and application logic.

    Because it's based on Perl, you automatically get a few bonus security features, like taint checking (which tracks user-provided data to ensure you don't use it in unsafe ways) and database libraries that use placeholders. Catalyst apps almost never use raw SQL either (they use libraries that create objects to represent the tables and records), so injection attacks are virtually impossible.

    If you don't want to use Perl, Ruby on Rails is fairly similar, and I know a lot of people swear by it; Ruby has a shallower learning curve as well. It doesn't have the libraries or userbase Perl does, though.

    --
    Hey, you try to find an open nick these days!
  45. Security expert's advice is very easy. by jez9999 · · Score: 0, Flamebait

    use Perl;

  46. Php weirdness by Anonymous Coward · · Score: 0

    PHP is interesting.

    Can anyone explain why the following code:

    echo print("2"). 3 . print("4");

    Results in the following output: 42311

    1. Re:Php weirdness by Anonymous Coward · · Score: 0

      Sure, you're using echo wrong. You should use "echo print("2"), 3, print ("4"); to get your desired output of :21341, though if you're really one of those ignorant php coders, and wanted an output like 234, you have better use echo 2.3.4, because print is a language construct which returns 1 always.

    2. Re:Php weirdness by Goaway · · Score: 1

      Of course he's using echo wrong, that's the whole point. I assume the question is, why is it outputting "42311" and not "42131"?

  47. Re:Question from a .NET developer trying to go OSS by I+Like+Pudding · · Score: 1, Informative
    Also, if you'd like to access a database with compound primary keys, ActiveRecord won't support that, but Catalyst's ORM (DBIx::Class) supports it fine.

    Bullshit

    Rails is good for quick apps like a wiki or a blog, but for more complicated internal applications, Catalyst is where it's at.

    I am hesitant to try any framework whose partisans routinely bash other frameworks. I'm used to getting this from Python; it's refreshing to see a Perl guy screaming at the wind.
  48. Re:Question from a .NET developer trying to go OSS by Anonymous Coward · · Score: 1, Interesting

    Well I moved from C# to Java a couple of years ago when a client wanted to be able to deploy to AIX. I found the transition dead easy. If you fancy taking a look at Java and want a good starter IDE you could do worse than look at Sun's Java Studio Creator which has a lot of the same look and feel as Visual Studio and is free and open source. If you want something that rocks and don't mind paying for it IDEA is easily the best IDE I've ever used for anything. Ruby on Rails is where all the hype is at the mo, of course, but I'm not much of a fan myself mainly because Ruby is so damn slow.

  49. If PGP... by Alioth · · Score: 3, Funny

    If PGP stands for 'Pretty Good Privacy', I wonder if PHP should really stand for 'Pretty Hopeless Privacy'...

  50. Re:Question from a .NET developer trying to go OSS by jrockway · · Score: 3, Insightful

    > Bullshit

    As the linked article said, this is an experimental patch + hack. With DBIC, you just do find({key1 => $val1, key2 => $val2}), which is a natural extension of the simple single-key case: find({key1 => $val1}). This all works very well in practice, as opposed to the it-might-work approach of ActiveRecord. I'm not saying you shouldn't use ActiveRecord... but I wouldn't use it.

    > I am hesitant to try any framework whose partisans routinely bash other frameworks.

    Bashing? I said it was good. There are some places where Catalyst is better, and some places where it's not as good. In my experience, Catalyst's good points make more complex applications easier (frontend to an HR system is what I've done), whereas Rails full-stack approach is great for CRUD applications. You're allowed to like both, ya know!

    > I'm used to getting this from Python; it's refreshing to see a Perl guy screaming at the wind.

    These people (I'm one of them) get upset because their languages are technically better than the alternatives, but "nobody" uses them, and they're shunned for not using PHP. "Perl is so 1996, man, use PHP or Ruby now." Irritating. use Perl; ;)

    --
    My other car is first.
  51. Re:Question from a .NET developer trying to go OSS by Anonymous Coward · · Score: 0

    If you do decide to go the Java route have a look at Seam and Ice faces. The combination of the two is very powerful and both are open source.

  52. If people used my butt to the extent they use php by unity100 · · Score: 0, Troll

    my butt would be giving buttloads of major security holes ...

    Something which is used extensively gets more flaws discovered than something that is used less. Get this in your heads.

  53. Re:Lemme guess... MySQL is also the best database? by fyoder · · Score: 3, Insightful

    Amazon has The Design of Everyday Things by Don Norman available second hand. He argues similarly. If a door has a sign that says 'push' and someone tries to pull, you can blame the user, but it would be better to design a door that invites pushing and discourages pulling. Or vice versa. abebooks.com also has some copies. It was also published as The Psychology of Everyday Things. Good read.

    --
    Loose lips lose spit.
  54. Re:Question from a .NET developer trying to go OSS by holy+zarquon's+singi · · Score: 1

    > I am hesitant to try any framework whose partisans routinely bash other > frameworks. I'm used to getting this from Python; it's refreshing to see a Perl > guy screaming at the wind. You win. Meta bashing is so much more mature.

    --
    "...we should just trust our president in every decision that he makes and we should just support that." B.Spears 2003
  55. Uh-huh, riiiiiiiiight... by Gordonjcp · · Score: 1

    And you know it was a PHP exploit *how* exactly?

    1. Re:Uh-huh, riiiiiiiiight... by vadim_t · · Score: 1

      You know, modern systems have this feature called "logs", and often you can determine what went wrong by looking there.

      For instance, if after to a break-in you notice somebody tried to ssh in 500 times unsuccessfully, perhaps the 501th one worked.

      In the PHP case, it's very likely the apache logs would have something interesting.

    2. Re:Uh-huh, riiiiiiiiight... by solidox · · Score: 3, Interesting

      There was an exploit for mambo some time ago, sql injection i believe, perhaps several others also, so mambo is a likely culprit.
      One cannot say it was PHP directly that got the machine compromised. It was an exploit in a script written in PHP.
      A box isn't going to get compromised if PHP was installed alone on the box without any scripts (at least it's very very unlikely).
      Is C the direct cause of your box owned when their is an exploit in say, proftpd for example?

      I mean, I could also say...
      "yeah, you'd have to be mad to run sendmail on a box you don't want to get owned"
      "yeah, you'd have to be mad to run proftpd on a box you don't want to get owned"
      "yeah, you'd have to be mad to run bind on a box you don't want to get owned"
      "yeah, you'd have to be mad to run a linux kernel on a box you don't want to get owned"

      These applications have all had their problems in the past, maybe some still have problems, but overall
      they get fixed when new exploits/bugs are discovered.

      I'm not quite sure why, but a lot of people/webmasters/admins do not check for updates to the 3rd party php scripts
      they have installed, they just install them once and leave them running... Then they wonder why their box was compromised
      due to them running out of date software.
      You wouldn't leave your windows machine unpatched and never check for updates, would you?

      --
    3. Re:Uh-huh, riiiiiiiiight... by masklinn · · Score: 0, Troll

      There was an exploit for mambo some time ago, sql injection i believe, perhaps several others also, so mambo is a likely culprit.

      Yup, but PHP (still) makes it really easy to open SQL injection holes in your apps, it's therefore some kind of meta-culprit.

      --
      "The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
    4. Re:Uh-huh, riiiiiiiiight... by Random+Walk · · Score: 1
      I'm not quite sure why, but a lot of people/webmasters/admins do not check for updates to the 3rd party php scripts they have installed, they just install them once and leave them running... Then they wonder why their box was compromised due to them running out of date software. You wouldn't leave your windows machine unpatched and never check for updates, would you?

      Do you check for updates of 3rd party apps installed on your windows box? Updating the OS is trivial, regardless whether you use Windows Update or apt-get. Tracking 3rd party applications is a PITA, and requires a significant effort. If you want to stay secure, you either have plenty of spare time, or avoid 3rd party apps like hell.

    5. Re:Uh-huh, riiiiiiiiight... by PaxTech · · Score: 2, Insightful

      C (still) makes it easy to create buffer overrun exploits in your apps, so is this the fault of C or the fault of the incompetent programmer using it? PHP is a tool, like a hammer. You wouldn't blame the hammer if you were careless and whacked yourself in the thumb, would you?

      --
      All movements for social change begin as missions, evolve into businesses, and end up as rackets.
    6. Re:Uh-huh, riiiiiiiiight... by Goaway · · Score: 1, Flamebait

      C is a language for experts. It should, and does, prioritize power over security.

      PHP is a langauge for beginners. You'd think it would prioritize security over power, but then it just copies C APIs with zero security functionality. (See the mysql_* functions. )

    7. Re:Uh-huh, riiiiiiiiight... by masklinn · · Score: 1

      C (still) makes it easy to create buffer overrun exploits in your apps, so is this the fault of C or the fault of the incompetent programmer using it?

      How the hell can you compare C and PHP?

      And PHP being a tool doesn't mean it's a good tool, if PHP was a hammer it'd have a soft-rubber handle and would only whack thumbs and never nails.

      --
      "The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
    8. Re:Uh-huh, riiiiiiiiight... by hey! · · Score: 2, Insightful

      Yes, SQL injection is not a language issue per se. It's a primarily problem of miseducation and the bad habit it forms. You learn string manipulation before you learn database access, and therein lies the source of the problem.

      But...

      There is something that the language people can do to stop it, not by changign the language, but by changing the standard libraries. If there was no library API which handed an abritrary string to SQL interpreter for one step parsing and execution, it would discourage the practices that make SQL injection possible.

      --
      Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
    9. Re:Uh-huh, riiiiiiiiight... by danbeck · · Score: 2, Insightful

      boohoo, welcome to system administration. It's not an easy job and assholes like you won't change that fact, no matter how much you whine. Who gives a flying fuck how much of a PITA it is, it's part of administering a system. Changing the oil in your car suck, putting gas in it sucks, why should a computer be any different? Even more so since it's a hell of a lot more complex system.

    10. Re:Uh-huh, riiiiiiiiight... by DragonWriter · · Score: 1
      If there was no library API which handed an abritrary string to SQL interpreter for one step parsing and execution, it would discourage the practices that make SQL injection possible.


      Don't many languages standardized DB APIs allow passing arbitrary strings to SQL interpreters in order to (1) support using SQL rather than language-specific methods of database access for most tasks, and (2) support, using a similar API, different back-end DBs?

      Lots of DB APIs also provide safer ways to pass in one or several sets of host-language values as parameters to an SQL query that are safer from SQL injection (and often more efficient for repeated operations) than just building a string, and encourage the use of those methods.

      Or am I missing something?
    11. Re:Uh-huh, riiiiiiiiight... by toadlife · · Score: 1

      Mailing lists.

      If the app you are going to run doesn't have one then beware. There are also some generic security mailing lists that are not product specific, like ISN. Bookmark your app's page on Secunia and check it every once in awhile. Secunia also has a mailing list that will mail you advisories.

      --
      I don't always use unix-like operating systems; but when I do, I prefer FreeBSD.
    12. Re:Uh-huh, riiiiiiiiight... by nuzak · · Score: 1

      > if PHP was a hammer it'd have a soft-rubber handle and would only whack thumbs and never nails.

      Actually, it would have dozens of heads that you couldn't detach, and you'd use a different head and have to hold it a different way depending on which kind of nail you wanted to hammer. And half the time you'll crack your board when using it, and never know it til it breaks in half.

      --
      Done with slashdot, done with nerds, getting a life.
  56. OMG!! by Panaqqa · · Score: 0, Troll

    PHP has security issues??!!!!

  57. Re:Lemme guess... MySQL is also the best database? by Anonymous Coward · · Score: 0

    Nice philosophy, but you're delusional if you think it can be applied to everything.

    It certainly won't work for power tools or programming languages...or even flatware.

    Maybe one day we'll have A.I.'s that make all the decisions for us, and robots that chew our food for us so we don't need forks. But then we won't be quite human anymore.

  58. Maybe he wants to become famous? by mw22 · · Score: 1

    So I read the piece from his blog and the heise article, I didn't see any remorse against Stefan from the PHP group. I can see Stefan making that accusation, though. It can be very difficult to fix bugs, and sometimes it can take a very long time. So - with the information I got thus far - I think Stefan is trolling and tries to get some publicity. That seems also be the reason why he wants to do a month of PHP bugs.

  59. Re:If people used my butt to the extent they use p by vga_init · · Score: 1

    Something which is used extensively gets more flaws discovered than something that is used less. Get this in your heads.

    That's assuming that the flaws exist in the first place. It's true that incredibly popular pieces of software a subject to more scrutiny and exploitation, but how much can go wrong is a characteristic unique to the design of the software itself, something that would be the same regardless of how many people used it. It would be rather obtuse to entertain the idea that all pieces of software somehow contain the same number of security flaws, and that's to say nothing about their magnitude.

  60. Re:If people used my butt to the extent they use p by MosesJones · · Score: 2, Interesting

    This would of course be why Java, probably the most widely used commercial language on the planet, has had so many massive security issues......

    Oh wait, it hasn't has it. It is also why Apache had so many more security issues than IIS4 because Apache was used... oh hang on that one doesn't work either.

    Maybe if you used you mouth rather than your butt for speaking you might make more sense.

    --
    An Eye for an Eye will make the whole world blind - Gandhi
  61. Re:Question from a .NET developer trying to go OSS by I+Like+Pudding · · Score: 2, Funny

    Any time I see a Rails vs. Django comparison, which is quite often, half of the Python users have their nose hiked 90 degrees into the air. They're maybe half as bad as the Lisp community (which rates a full centidijkstra in arrogance). I don't represent this as being scientific fact, but it is exactly what I have observed.

  62. Re:Lemme guess... MySQL is also the best database? by Anonymous Coward · · Score: 4, Informative
    I don't think PHP was designed as an easy way to make secure web scripts. Maybe easy, but certainly not secure.

    The classic example is the database access API (or maybe it's specific to mysql, I forgot). It doesn't support bound parameters. Use of placeholders ('?') and bound parameters is a must for secure SQL, but PHP doesn't support them, and instead requires the developer to jump through hoops escaping user-supplied data which must be passed as literals into the SQL statement.

    Although it might be possible to make a secure SQL-using PHP script, the odds seem against it. Everytime I look at the changelogs of popular PHP applications, I see new fixes for SQL injection vulnerabilities. Clearly programmers don't always remember to escape those literals!

    Lack of placeholders also affects the database's ability to cache prepared statements. Statements full of literals are different each time through the loop, whereas parameterised statements can be executed more quickly.

    All in all, PHP strikes me as a toy language and not well suited to writing secure systems.

  63. Re:Question from a .NET developer trying to go OSS by Anonymous Coward · · Score: 0

    That was a retard's joke back in '97!

  64. Re:Question from a .NET developer trying to go OSS by bahface · · Score: 1

    Rails doesn't scale well. Even the rails devs will tell you that. And yes, I know this, because I've been to a conference where the rails presentation said just this. We use PHP on an enterprise level for a major bank in a G7 country. I don't want to say which one for business reasons. It's clear you don't know much about Rails or PHP. Also, if you want to build something 'serious' then you wouldn't use JSP. By now, you'd think people would realize that mixing data and logic is bad. It's amazing how many people still do this blindly.

  65. As a PHP developer, I disagree by Qbertino · · Score: 2, Insightful

    PHP has many eyes, yes. That's one of it's great advantages. But it also is prone to security issues. Any grown up PHP dev will admit that flat out. Fault tolerance, Reverse proxy, URL dispatching, close ties with the Framework/CMS team, basic brain functions when configging Apache and the underlyin OS, common ground standards of secured client server communication and some other details are part of the regular toolkit of PHP developers to deal with these issues. The versatility of PHP comes with that tradeoff, one has to deal with it, period.

    --
    We suffer more in our imagination than in reality. - Seneca
  66. Re:Lemme guess... MySQL is also the best database? by JackHoffman · · Score: 1

    I mostly agree, but you know the saying: When you build a foolproof tool, nature makes bigger fools. There is a balance where automatic overrides don't introduce more problems than they solve. Every uncaught user error beyond that limit isn't even partially the tool's (or the tool builder's) fault. A car navigation system is a problem in itself if it tries to prevent you from driving off a cliff while you want to cross the gap on the newly built bridge.

    On the matter of PHP, I have no doubt that the language is problematic. There are just too many non-obvious ways to shoot yourself in the foot. A language which is mostly used to process untrusted input should make it easy to write code that is safe from certain low level attacks. The language cannot enforce proper application logic, but it shouldn't take as much knowledge and leg work to avoid run-of-the-mill code injection as it does with PHP.

  67. Re:Lemme guess... MySQL is also the best database? by masklinn · · Score: 4, Insightful

    It certainly won't work for [...] programming languages

    Yes it does. It's a question of design, the design of the programming language, of its documentations and of its library can make security holes much harder to create.

    When it actually becomes harder to do the wrong thing than to do the "right" thing, creating security holes becomes the fault of the user. When it's much harder to do the "right" thing than the "wrong" one, and most documentations suggest the "wrong" thing, then it's completely the fault of the language.

    Most PHP issues are the latter.

    --
    "The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
  68. Flexibility by Anonymous Coward · · Score: 0

    Flexibility is a double edged sword because it allows programmers to do everything more easily, including writing bad code, but I am in favor of that because it rewards good programmers. I don't think good programmers should be punished by reducing PHP's flexibility just because there are some (or even many) stupid PHP programmers out there.

    Primarily, creating a secure application requires that the programmer considers security in the design of the application; syntax is NOT -and should never be- the primary source of security in any application because that would make the language incredibly inflexible and I'd venture that most PHP vulnerabilities are caused by programmers who did not consider security in their design, which would still be a problem if they used any other programming language.

  69. Re:Question from a .NET developer trying to go OSS by masklinn · · Score: 1

    Rails doesn't scale well.

    Use Django then, it does.

    --
    "The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
  70. Mod parent up by Futurepower(R) · · Score: 0, Redundant

    Mod parent up, please. Excellent information.

  71. Re:Question from a .NET developer trying to go OSS by kestasjk · · Score: 1
    PHP IMHO is a nice toy but nothing I would use in a commercial project.
    I agree that PHP has problems that make it easy for non-experts to leave their scripts wide open, and create terrible, kludgey code; but that does not somehow make it impossible to write good code in PHP.

    It's a flexible language compared to Java (this has its benefits too of course), and it has a lot of exposure to people who can't program, but that doesn't mean that good code somehow cannot be written in it.
    --
    // MD_Update(&m,buf,j);
  72. PHP is the laughingstock of the OSS workd. by Anonymous Coward · · Score: 0

    We use some web apps on our internal network. Most of them are written in Java, with a few legacy Perl scripts still being used. We're going to be developing some new applications soon, and as part of the process we had to decide what language and frameworks we were going to use.

    At a recent meeting, one poor fellow decided to suggest PHP. You should have seen the reaction! All at once about eight or nine of the other developers and architects just started laughing outright. One even had a memorable line: "We will not use PHP anywhere in our network. Gonorrhea on a camel's gonads has better security than PHP." I've never seen an idea shot down so quickly. And I'm thankful it was.

    1. Re:PHP is the laughingstock of the OSS workd. by Schraegstrichpunkt · · Score: 1

      I want to work where you work!

  73. Re:php is the best language still by doublebackslash · · Score: 1

    engineering

    --
    md5sum /boot/vmlinuz
    d41d8cd98f00b204e9800998ecf8427e /boot/vmlinuz
  74. Why...? by Keeper+Of+Keys · · Score: 2, Insightful

    Could someone explain to me why I can never EVER see the first comment? I have to infer what was said from the second comment. In this case, I presume the first poster said that PHP was the best programming language. I am using the newfangled AJAX-y comment thread expandomatic, but there's no button to click to see the first comment if it's been modded down.

    1. Re:Why...? by TheNinjaroach · · Score: 1

      Did you try clicking on the Subject of his post? I think it used to take me to another page, but since the Javascript stuff came in it simply expands the thread.

      --
      I went to eat some animal crackers and the box said, "Do not eat if seal is broken." I opened the box and sure enough..
    2. Re:Why...? by Keeper+Of+Keys · · Score: 1

      Can't even see the subject. It goes from that "Fine Print" panel thingy straight on to replies to the first comment. Oddly, I can see the title if I turn off the CSS. I'm using Firefox 2.0. Happens with non-trollish first posts, too.

    3. Re:Why...? by serialdogma · · Score: 1

      I find clicking on the "Parent" link brings it up.

    4. Re:Why...? by Keeper+Of+Keys · · Score: 1

      It worked! Thanks

  75. Re:Question from a .NET developer trying to go OSS by Anonymous Coward · · Score: 0

    "I am hesitant to try any framework whose partisans routinely bash other frameworks."

    Says a Rails guy...

  76. Re:Lemme guess... MySQL is also the best database? by Dragonslicer · · Score: 1

    You're giving users far too much credit. When a user asks how they can set a variable on line 50 of a script and use the value of that variable on line 20 (no, not functions), and insists that it must be done that way, there's only so much a language can do to help that user. PHP has/had its fair share of problems, many of which have been fixed (register_globals and magic_quotes_gpc have been off by default for a long time, register_globals will be removed completely in PHP6), but a complete idiot will write terrible code in any language. Most languages are just too difficult for complete idiots to figure out.

    Like all other programming languages, PHP is a tool (cue jokes). A person that knows how to use the tool well can do some very impressive work with it. A person that doesn't know how to use the tool will probably just break stuff.

  77. Movement against PHP by robsy · · Score: 1

    Reading all the comments about PHP throughout the years, I think it's about time that Slashdotters unite against PHP(and Microsoft and...add whatever it is that Slashdotters hate).

    I think the functionality of the language is it's biggest enemy when it comes to security. If the language is simple enough like for instance you can only make programs that can print out "Hello world" then it can be considered very secure. It's maybe not very useful, but very secure.
    I know programmers who should never be allowed to program in anything but Java or C# and then only simple code.

  78. Re:Question from a .NET developer trying to go OSS by I+Like+Pudding · · Score: 2, Funny
    Says a Rails guy...

    The only Rails guy I see routinely mouthing off is DHH. Most of his invective (that I've read) is aimed at Java, though, which is a mitigating factor. J2EE is easy to bash because you'll be right most of the time.
  79. Re:Lemme guess... MySQL is also the best database? by fatcop · · Score: 2, Insightful
    I think its a bit more subjective than that.

    You have to know your programming language, and I don't just mean syntax. Know what it aims are. There are always compromises to be made in programming. Some languages (eg. C/C++) allow low level platform dependent control, some (eg. Java) no pointers (use GC's) and cross platform, others (eg. Perl, PHP) allow RAD, massive library support.

    When I first started dabbling in PHP I recall it being billed as an easy language to learn so non-hardcore programmers could ease into web design. I've seen excellent graphic artists get by with enough PHP to get the job done. They are pushing content and rely on popular CMS's to take care of the scary stuff.

    PHP could probably use improvement, what can't, but people harp on about it needing typed variables etc, to me that raises the bar of entry and goes against some of PHP's strengths. Consider for a moment that not everyone has a mindset for typed variables and that their is power with untyped. There are other languages if this feature is a show stopper for you.

    If there are bugs in CMS's (or whatever) written in PHP, then those (professional) programmers made errors. You really don't ... go blaming your tools. You chose them.

    Programming has always been been about finding better ways of dealing with gotchas in all programming languages, whether they be memory leaks or catching untyped variable issues.

  80. Re:Lemme guess... MySQL is also the best database? by TheNinjaroach · · Score: 0, Redundant

    If I smash my thumb in with a hammer, can I blame that tool as well? Sounds like a glitch in the hammer by your standards.

    --
    I went to eat some animal crackers and the box said, "Do not eat if seal is broken." I opened the box and sure enough..
  81. Java made easier by Anonymous Coward · · Score: 0

    A big problem with regards to PHP vs. Java is that its awfully harder to get Java going in a server-side fashion on your box. Where you only need a simple Apache module for Java you'd need a product like the Tomcat server to get the best out of Java. Which, for a common user, means more trouble and overhead. Now you got 2 software products to configure which can make your life a lot harder.

    When looking at the Java Enterprise Edition (EE5) you'll notice that it comes with its own application server called Glassfish, its even fully open sourced. However, even though its a lot easier to setup and tune Glassfish when compared to Tomcat (a nice spiffy web interface in which you can do everything vs. a limited administration interface and lots of manual editing of config files) its still making things too complex for common use. You still need at least 2 ports opened up (one for webserver, one for application server) or figure out a way how to start forwarding requests.

    No more. A very good alternative for all this complexity is the Sun Java Webserver 7. Its not offcially released yet, this is the 3rd release candidate, but despite that its very useable. This is basicly a combination of both an extensive webserver which can easily compete with the likes of Apache and a java container (or "application server") fully embedded into the system. So you only need to worry about a single software product to setup both your web and application -server needs.

    There is a little thing to keep in mind: when it comes to Java technology (EE5) then you'll notice that the Java webserver 7 is a little behind in some regards. The support for JSP, servlets, etc. doesn't keep up with the latest versions but supports standards (jsp, serlvets, jsf) which are one release or such behind. But that doesn't mean its functionality is any less than Tomcat or the Sun application server.

    If you're now considering Java but looking up to maintaining 2 software products I'd definatly check this out. It runs on Windows, Linux and even Solaris (duh, as if that wasn't to be expected from Sun ;-)).

    1. Re:Java made easier by chez69 · · Score: 0, Flamebait

      you don't need a whole freaking J2EE stack to do web programming in java, it's really easy to get a tomcat installation setup and write some jsps.

      J2EE is a huge specification, but nothing requires you to use all of it.

      --
      PHP is the solution of choice for relaying mysql errors to web users.
  82. Re:Question from a .NET developer trying to go OSS by Anonymous Coward · · Score: 0

    Why not just use Mono? It's an open source implementation of .net http://mono-project.org/

  83. Re:Lemme guess... MySQL is also the best database? by Nos. · · Score: 2, Informative

    Have a look at the PEAR library sometime, specifically MDB2. It does what you're looking for in PHP.

  84. Yeah, but J2EE and EJB will mess with your mind by HighOrbit · · Score: 1

    While the basic concepts between C# and Java might be similiar (I haven't gotten around to C# myself yet), java has some pretty strange things entrenched in they way that it is employeed. For webapps, EJB and J2EE will leave you in a straight jacket. Granted there are alternatives to EJB (Spring, Hibernate, etc), but EJB is still "the standard" way to do java on webapps, if you are going for anything more than a servlet. I have poured over several J2EE books and I still have a hard time wrapping my mind around EJB and the umpteen levels of abtraction and interfaces required to use it properly. Somebody one said that "Java programers have a morbid fascination with complexity"; that is absoutlely true of the twisted minds who thought up EJB. My gosh, the J2EE Tutorial from Sun is *several hundred* pages long.

    PHP has its problems, but I find it much more satifying because it is more straight forward. It's easy to write bad code in PHP, but its also easy to write good code in PHP. PHP is definately a less versitile and less powerful tool than Java, but its still a good tool for its intended job.

    1. Re:Yeah, but J2EE and EJB will mess with your mind by Shados · · Score: 1

      While EJB is standard J2EE, it actualy didn't catch on really well. That is also why I -specificaly- mentionned in my post that a C# developer going in the Java world should consider certain frameworks.

      That being said, EJB is a common platform to do things that .NET separated more explicitely, but the idea remains the same. It is simply that a handful of .NET concepts, when translated in Java, all converge to EJB and normal javabeans. Anyway, they are not used as much as one would think they are.

      However, EJB 3.0 simplifies a lot of EJB related tasks, to the point of making them quite easy, so when those become standards, that won't even be an issue anymore. Looking at standard EJB tasks in the EJB 3 specs, it looks like one can pick a lot up in an afternoon.

  85. Re:Lemme guess... MySQL is also the best database? by Dragonslicer · · Score: 1

    http://www.php.net/manual/en/ref.pdo.php is probably what you're looking for.

  86. Re:Question from a .NET developer trying to go OSS by Anonymous Coward · · Score: 0
    It's clear you don't know much about Rails or PHP. Also, if you want to build something 'serious' then you wouldn't use JSP. By now, you'd think people would realize that mixing data and logic is bad.

    Being a hypocrite is just as bad.
  87. Re:Question from a .NET developer trying to go OSS by nxtw · · Score: 1

    I would advise using ASP.NET in mono (if you can get it to work, I have had difficulties in the past) or Java.

    Java is actually *used* by a great number of people, compared to the rabid fanboyism and hype surrounding some other technologies.

    Whatever you do, don't use MySQL. PostgreSQL is many times better.

  88. Re:Question from a .NET developer trying to go OSS by oc255 · · Score: 1

    Says a Rails guy... I went to see Dave Thomas talk about Ruby on Rails (he has that pickax book out), this was exactly one of his points and it had little to do with pimping his book. He said something to the effect of: There are no plain programmers anymore. People are J2EE programmers with Hibernate, Spring, Framework N experience. Sure people can't know everything, it's good to specialize. But his point is still valid. I agree with him and I think people are in one camp and very rarely in two mismatching camps at the same time. You're either in Python and against Perl but rarely see a Java and Perl guy.
  89. Re:Question from a .NET developer trying to go OSS by I+Like+Pudding · · Score: 0

    -1? Wow, I thought my winning the argument with LOGIC would have negated a troll mod.

  90. Re:Question from a .NET developer trying to go OSS by TheRaven64 · · Score: 1

    It depends on your task. If you are building small to medium-sized web-applications, I would recommend Seaside. For larger projects, there are things like GNUstepWeb and Struts. If you want something slow that doesn't scale well, but is 100% buzzword-compliant, then there's Ruby on Rails. If you want to re-use existing ASP.NET code then you could try Mono.

    For many needs, Apache is not a good choice. I personally prefer Lighttpd, which is lighter, faster, and easier to configure. It has nice FastCGI integration, so you can use it with most frameworks.

    As for databases, I still haven't found a good reason to use MySQL. If you need a real database, I'd go with PostgreSQL, which is more standards compliant than MySQL, and faster for complex queries. If you want something slightly more structured than a flat file, then try SQLite, which is simple, lightweight, and faster than MySQL for simple queries.

    --
    I am TheRaven on Soylent News
  91. Re:Question from a .NET developer trying to go OSS by Anonymous Coward · · Score: 0
    I am hesitant to try any framework whose partisans routinely bash other frameworks. I'm used to getting this from Python; it's refreshing to see a Perl guy screaming at the wind.
    Bluntly showing such an ignorance (you haven't got the slightest idea about Perl5, and probably even about Ruby and Rails) is much worse than being a partisan.
    And automatically labeling someone as a partisan (when he even said that he likes Rails!) just because you have never been able to write a single line of Perl code, is even worse.

    (BTW, Catalyst is 10 times more flexible than Rails.)

    Emanuele.
  92. so how many holes is that? by Anonymous Coward · · Score: 0

    So how many holes does your butt have, anyway? Or are you still trying to find them all?

  93. Re:Question from a .NET developer trying to go OSS by Czaries · · Score: 2, Insightful
    There sure are better alternatives to PHP in the OSS sector! PHP IMHO is a nice toy but nothing I would use in a commercial project.

    You mean you would never use PHP in commercial projects like Flickr, Digg, Yahoo!, del.icio.us, imageshack, hotscripts, or other sites of that caliber, right? Well those websites ALL use PHP. Get your head out of the "let's bash the programming language itself instead of just criticizing the bad programmers who make it look bad" club. There are lots of ways to write insecure code, sure. But there are also lots of ways to write secure, efficient, well-designed code that can handle hundreds of thousands (even millions) of requests each day, and these sites prove it.

    The reason you can quickly find so much insecure code is just a side effect of the low barrier to entry. PHP is one of the easiest to learn programming languages I know of, and because of that, you have people writing code that have never programmed before in their life. Of course their code is going to be shitty and insecure - they haven't been taught better. It is possible to write insecure code with any almost any language, so don't bash the whole language overall. It's not a bad programming language just because it doesn't hold your hand or prevent you from shooting yourself in the foot.

  94. Re:Question from a .NET developer trying to go OSS by ackdesha · · Score: 1

    I think I've been around the block with the options:

    • J2EE/EJB - Not on your life. I'd rather change careers.
    • J2EE/Spring - Better, still too complex for simple projects. A good idea, but I found myself spending my days editing XML instead of coding - that's no fun. :)
    • ASP.NET - A good framework, perhaps trying too hard to make web development like traditional GUI development. My problem here is depending on Windows and Microsoft. I know I can get the API at no cost without VS.NET, but no thanks. They got my $3000 once for VS.NET. Never again.
    • Rails - Great framework, fun to work with. If you aren't well versed in OO design and Ruby's unique dynamic features this may really confuse you. Rails might just be too clever some people. Also see the Perl and Python projects that are similar. I've enjoyed using Catalyst but found it frustrating to deploy (I believe they have a solution to this now with the PAR support).
    • PHP - I've built business applications from the ground up using PHP and will not do it again. Testing and Debugging PHP is a nightmare compared to the tools available in mod_perl, Rails or J2EE. There probably are tools that make that easier. If so, the PHP manual should make that the first chapter.

    However, my current solution that gives me the most productivity is to install Drupal and add functionality using Drupal PHP modules. That way I delegate the design, security and most of the maintenance to the Drupal team. I only worry about coding the correct "hooks" for my application. Drupal provides an API that takes care of most common tasks. For example, last weekend I took a project I wrote in ASP.NET to query stock transactions (result paging, complex search controls) and reimplemented the functionality as a drupal module in 1 day. The original project took me 2 weeks in ASP.NET.

    I just look at the code for the built in modules as my guide. Once I understood the hook API and looked at some examples I've found I can put together complete applications in hours, not days or months.

    If there were a Drupal equivalent for Ruby or Perl that was as mature, I'd jump at it.

  95. Re:Question from a .NET developer trying to go OSS by Requiem · · Score: 2, Interesting

    Third(ed?). I use some C# at work (C++ is the normal, everyday language), and it's remarkably similar to using Java, especially when you don't use any of the more esoteric features.

  96. Re:Question from a .NET developer trying to go OSS by Anonymous Coward · · Score: 0

    Any language that tries to check my taint is a language I don't want.

    Keep your code out of my nether regions!

  97. PHP == Bloat? by ThePhilips · · Score: 1

    Is it only me who thinks that PHP after version 2 started getting so much weight and bloat that I would believe anything about how insecure it had become.

    Rate new features/functions added to PHP at times seems to be exponential. Something that points to poor project management: it looks like incapable of handling the exploded PHP popularity and attention it gathered.

    Though my opinion might be outdated: I was programming PHP last time when version 3 was getting its first releases.

    --
    All hope abandon ye who enter here.
  98. Re:Question from a .NET developer trying to go OSS by herve_masson · · Score: 1

    PHP IMHO is a nice toy but nothing I would use in a commercial project.
    A soon to be totally OS sollution is of course JAVA with Apache and Servlets/JSP

    I doubt people enjoying PHP would actually find their way into JAVA; not those I know at least. I really dislike PHP, but I recognize it has vertues: it is something that a *lot* of people can use, like VB for example. Unlike JAVA. Unlike perl. Unlike many (most?) other things.

    Saddly, it's something that also give unexperienced programmers very bad habbits, such as accomodating broken and unorganized APIs (not surprizingly, their code looks as broken and unorganized as the API they're using). Not even mentionning the configuration and troubleshooting hell.

    I find that the most ugly aspect of PHP is the way it sometimes approaches standard programming concepts in a very "exotic" way.
    This cause a lot of problem to me because I've strong references in other language/platforms, but seems to be okay to those unexperienced users who usually don't realize there's something odd/strange.

  99. Re:Lemme guess... MySQL is also the best database? by tobiasly · · Score: 3, Informative
    The classic example is the database access API (or maybe it's specific to mysql, I forgot). It doesn't support bound parameters.

    It's obviously been a very long time since you've coded in PHP. The native PDO layer in PHP 5 supports bound parameters for all database drivers, and there are numerous other data abstraction layers that support this which have been around even longer.

    Just because all these "popular PHP applications" you mention (care to cite examples?) don't follow good programming practice doesn't mean the language itself is flawed. PHP can't force someone to write good code.

  100. Re:Question from a .NET developer trying to go OSS by popular · · Score: 1

    I don't know any guys who do Java and Perl, but I do have a female friend who does...

  101. Re:Question from a .NET developer trying to go OSS by IpalindromeI · · Score: 1

    The new language features? Taken from Haskell. The only functional implementation at the moment? Written in Haskell. OOPS.

    What do you have against Haskell? Haskell kicks ass.

    --

    --
    Promoting critical thinking since 1994.
  102. Easy way to make PHP more secure... by flight_master · · Score: 1

    Actually get some friggen types implemented! Then, half the SQL injection flaws that are in PHP scripts would become null.

    --
    "Free software" is a matter of liberty, not price.
    1. Re:Easy way to make PHP more secure... by MadAhab · · Score: 1

      Bah. Types are a boring straightjacket. And they don't do much for preventing SQL injection - as long as one of the types is text, and PHP programmers are still putting together their queries

      Parameterized queries is a powerful way of doing it - it doesn't prevent all nonsense, but it sure as hell puts a stop to your garden variety SQL injection. Guess what? PHP doesn't, last I checked, have parameterized queries.

      Unfortunately, most PHP programmers I've encountered simply don't even understand why SQL injection is a problem. I once had a contractor offer, to my boss, on our dime, to research whether this "SQL injection" security thing is some kind of problem. He should have been fired on the spot.

      --
      Expanding a vast wasteland since 1996.
    2. Re:Easy way to make PHP more secure... by Anonymous Coward · · Score: 0
      Guess what? PHP doesn't, last I checked, have parameterized queries.

      *sigh* check again please.
    3. Re:Easy way to make PHP more secure... by flight_master · · Score: 1

      I guess, but still, I know MANY, MANY scripts that simply use
      SELECT * FROM `members` WHERE `member_id` = $_GET['id'];

      By simply stating that $_GET['id'] is an INT, it'll prevent what would otherwise be a really, really big SQL flaw. Of course, all languages are only as secure as the developers working with them ;)

      --
      "Free software" is a matter of liberty, not price.
  103. Re:Question from a .NET developer trying to go OSS by Anonymous Coward · · Score: 0

    Hosting for a servlet engine or Rails or mod_perl is more difficult to find than PHP/MySQL hosting.

  104. Re:Question from a .NET developer trying to go OSS by afd8856 · · Score: 1

    There is for python (Plone)

    --
    I'll do the stupid thing first and then you shy people follow...
  105. Re:Question from a .NET developer trying to go OSS by I+Like+Pudding · · Score: 1

    Follow the argument. The GP said that Perl was technically superior. I countered with the fact that Perl is doing a huge rewrite and taking a bunch of ideas from Haskell. This is not a slight against Haskell, which I would describe first and foremost as "thought-proviking"; it is, instead, proof against the imagined technological superiority of Perl 5. Perhaps I was not clear: the "OOPS" was meant to be taken against the statement of technological superiority, not the use Haskell.

  106. Re:Question from a .NET developer trying to go OSS by Anonymous Coward · · Score: 0

    I dont know why but whenever I *accidently* open a webpage with Java on it I have to sit still for 2/3 minutes. My browsers (FF2 & IE7) would not allow me to even go to other tabs and do something.

    Its a nice short break every once in a while.

    However if I am in a hurry sometimes I have to KILL the browser and start doing everything again while avoiding the JAVA *enhanced* website.

    So if JAVA is the future, I am off on holidays.......

  107. Re:php certainly is the best language... by suggsjc · · Score: 1

    Only on /. would that get modded "Insightful"...

    --
    When I have a kid, I want to put him in one of those strollers for twins and then run around the mall looking frantic.
  108. Re:Question from a .NET developer trying to go OSS by Fweeky · · Score: 1

    "if you'd like to access a database with compound primary keys, ActiveRecord won't support that"

    It will, it just needs a plugin for the time being. And nothing's stopping you from using Og or some other ORM layer (or no ORM layer) if ActiveRecord's insufficient.

  109. Re:Question from a .NET developer trying to go OSS by I+Like+Pudding · · Score: 1

    Actually, I once wrote an ActiveX component in perl that talked to a Java server (which I also wrote) via XML diff. The diff itself was also XML. Java was great for the combo of XML processing and heavy networking support that I needed. NIO had just come out, otherwise I would have been forced to use C++.

    If you want to talk of language I use daily, I'm more of a Perl guy than anything else. I'd be much happier using Ruby or Python or Haskell or whatever, though, as I am sick of writing $this->{shit} = [qw(oh god the pain)];

  110. A more secure language by beemishboy · · Score: 2, Insightful

    If I am a web app developer, sure something might be easy to use, but who gets blamed if security is breached - me.

    Why would I want to use a language whose governing body decides that it's not worth fixing architectural security problems and leaves the burden to me as a developer? I have enough to worry about with deadlines, bureaucracy, Microsoft, the RIAA, RSI, IRS, etc. :-)

    Sure you take the good with the bad with any programming language, but I think they might be shooting themselves in the foot if the outgoing security guy's statements are accurate.

  111. Re:Question from a .NET developer trying to go OSS by jrockway · · Score: 1

    Composite plugin find:

            ModelName.find val1, val2

    OH SHIT, THAT TOTALLY DIDN'T FIT INTO THE ORIGINAL DESIGN! Also: the syntax is ten times more elegant than your Perl example.


    Oh good, positional arguments. Who decides the order? They're not positional in the database...


    Yeah, it's so technically better that gradual extension of the language was stopped in favor of a full redesign and 10 years of labor on a new VM. OOPS. The new language features? Taken from Haskell. The only functional implementation at the moment? Written in Haskell. OOPS.


    The internals of Perl are old. Over the years, they've come to be fairly full-featured and quite speedy... but they're 10 years old. Any piece of software that organically grows for 10 years is going to become a maintenance nightmare, and that's the state of perl right now. Hence it's time for a rewrite.

    Perl 6 (the language) takes some features from Haskell. I don't see the problem -- Haskell has some good ideas. So does Ruby, so we're borrowing from there too. Perl6 is designed to be a language that anyone can use, regardless of whether they prefer functional or declarative syntax (this is partially true in Perl5; see map/grep).

    As you note, Pugs is written in Haskell. Who cares? Is everything a rip off of C since it's implented in C? Pugs' purpose is to be a prototype of the real implementation. It's much easier to do the final implementation (on Parrot) when you've had somewhere to play with the concepts. You're welcome to start porting some of the complicated stuff to Parrot any time you want. This Saturday is "Parrot bug day", so why not stop by the IRC channel (irc.perl.org #parrot) and hang out?

    Lastly, why is any of this stuff an "OOPS"? If you actually looked at these projects, then you'd be really excited about how easy programming is going to become in a year or two. Why criticize something that you can directly benefit from? Why not help us make it happen sooner instead?
    --
    My other car is first.
  112. Re:Question from a .NET developer trying to go OSS by jrockway · · Score: 1

    Perl has borrowed from other langauges too -- sh, awk, sed, C, lisp, etc. Since perl5, some interesting new languages have appeared, so it's time to integrate these into perl :) Perl is designed to be a one-stop-shop for solving your programming problem and getting on with your life, not to be a "real programmers only need xyz functionality".

    Anyway, I don't understand why you think borrowing good ideas is admitting failure.

    --
    My other car is first.
  113. Re:Question from a .NET developer trying to go OSS by Anonymous Coward · · Score: 0

    And let's not forget Wikipedia (MediaWiki is written in PHP)

  114. If not PHP, then what? by Mikenotmike · · Score: 1

    Ok it's obvious that seasoned coders have a distaste for PHP. But what would the recomendation be for someone who's about to embark on several web projects, and thought PHP / MYSQL was the answer? I'm 100 pages deep in my 2nd PHP book and you guys just scared the **** out of me... I'm ready to hit the book store tonight and start a new approach, but where to start? Assuming I take the Perl route, what books would you recommend to take me from a novice to a worthy code writer?

    1. Re:If not PHP, then what? by mandelbr0t · · Score: 1

      I'd read the DBI book (O'Reilly) and the CGI perldoc. That should be about 95% of the stuff that PHP is used for.

      mandelbr0t

      --
      "Please describe the scientific nature of the 'whammy'" - Agent Scully
    2. Re:If not PHP, then what? by Anonymous Coward · · Score: 0

      Ruby for Rails by David A. Black.

      And, for the love of god, go with Postgres rather than mysql.

    3. Re:If not PHP, then what? by Anonymous Coward · · Score: 0

      If you've started learning PHP, then yeah Perl's probably going to be the easiest switch since PHP has it as it's syntactic parent. It's a good language for pragmatists as well.

      Ruby is cute, but it's still relatively young, it's slowish, and no tainting last time I checked. Ruby 2.0 should be much better though. Damned good in fact.

      And there seems to be a fair amount of crossover between the Perl and Ruby community, with good ideas stolen in both directions.

      But if you go down the Perl route remember the golden rule.

      "90% of every program you will ever need to write already exists on the CPAN."

      So if you get NOTHING else beyond reading say "Programming Perl", you should spend half your life at http://search.cpan.org/.

      Perl's true place in the world hasn't been about the language syntax itself for a long time. It's all about the 20 million lines of code in the CPAN.

      In fact, most of the entire Perl world probably has the same "cpan" search bookmark in Firefox at this point :)

    4. Re:If not PHP, then what? by Anonymous Coward · · Score: 0

      Ruby does have tainting and it's been there for a while (i cba to find a resource dating further back than 1.6 -- that's 2000-ish?).

      http://www.rubycentral.com/book/taint.html

    5. Re:If not PHP, then what? by Mikenotmike · · Score: 1

      Why Postgres? I read their website and it sounds great, but mysql isn't the security leak in PHP's structure from what you guys have said, isn't the current version of MYSQL capable of handling the same amount of data that postgre boasts of themselves? I press the issue because I'd prefer to knock out the large part of my learning experience in just one book for now (time constraints), and the only Perl book I can find that wraps itself with web development, uses Mysql as it's database backend throughout the entire book.

    6. Re:If not PHP, then what? by Slashdot+Parent · · Score: 1

      Use MySQL. There is nothing wrong with it for your purposes.

      Yes, postgres is better, but you don't need it now. You'll know when you do and you can take the time to learn it at that point. Postgres is harder to learn, and you won't benefit from the areas it beats MySQL in. Learning postgres is a waste of time for you right now. Wait 'till you need it.

      --
      They don't grade fathers, but if your daughter's a stripper, you fucked up. --Chris Rock
    7. Re:If not PHP, then what? by FrostedChaos · · Score: 1

      mySql cheats on a lot of database guarantees, and didn't handle views correctly for a long time.
      postgresql is much more solid.

      That being said, I think the choice of language is much more important than the choice of database.
      Whatever you do, don't use PHP-- just "training wheels without the bike," as the Perl people like to say.

      --
      "Any connection between your reality and mine is purely coincidental." -Slashdot
    8. Re:If not PHP, then what? by Anonymous Coward · · Score: 0

      "Postgres is harder to learn" -- really? how is that?! Don't listen to the guy above, this is bullshit.

      Mysql isn't easier to use, you'll learn a ton of bad habits, and there would be a new set of tools to learn when you need to switch to a proper db.

      Go with Postgres from the start.

  115. Re:Question from a .NET developer trying to go OSS by I+Like+Pudding · · Score: 1

    If Perl 5 was technologically superior, as the guy I was arguing with stated, nothing would need to be borrowed. I never said or implied that stealing ideas from Haskell is a bad thing - I think quite the opposite. We agree, you're just misinterpreting what I said.

  116. Re:Question from a .NET developer trying to go OSS by Joe5678 · · Score: 1

    The GP was talking about server side Java and made no mention of Java applets which is what you're talking about.

  117. PHP is the best! by imkow · · Score: 1

    Being simple is good.
    we just need a powerful tool to get job done!
    there is no need to use a full-featured and mysterious "Real" programming language like Java , only for webs!. it's like shooting mosquito with missiles.
    security is an everyday issue... see windows, a multi-billion program that still has security holes.

    PHP , popular ,powerful, handy, everythere! use it, improve it, dont judge it!(critics shall only go make their own prefect language).

    --
    China, in fact, is very fragile.
    1. Re:PHP is the best! by whip32 · · Score: 1

      I would like to comment on that statement. Developers or novice class users know something about using that many don;t. If you go along with you system and usage history by staying consistent as never want to learn all the fancy stiff in program languages and a few other secrete things that I can't tell you. The system it self gives you free programs. If you really work a developing then you discover free software magically appears on your system. With the day you open it as it property, It's like a gift. That is a secrete to why we keep at it. The free stiff we magically receive You also get special icons that no one else has and advanced functions that no one else has. Oh WELL.

    2. Re:PHP is the best! by imkow · · Score: 1

      I know what you mean. but if you dig php deep enough, you will find that inside php is all about C++ components. PHP in fact is just glue for those all-mighty components(which have been used everywhere in GNU systems.eg. curl,iconv,ming,libxxx. maybe you guys should blame GNU for bad design or security faulty.). so are Perl, Ruby or Python. they all shared the same goods and bads of a dynamic-typed/scripting language.. Using PHP wisely could greatly power your application, reducing your development time. and not like JSP/Servlet of java or WebForm of dotNet, php dont have an unified/universal development mode. Ten people can have ten different approaches to cook their works out.. some feeling bad about php can be a result of an unwise project design or bad coding practice! for those people , i'd like to recommend you to pick up a PHP framework, which are so many there!

      http://en.wikipedia.org/wiki/List_of_web_applicati on_frameworks pick one in php section. there are dozens of them.

      --
      China, in fact, is very fragile.
  118. Re:Question from a .NET developer trying to go OSS by shutdown+-p+now · · Score: 1

    The problem is that PHP is objectively a bad language. It does not really have a meaningful niche. When presented as a language for beginners, it makes it too easy for them to shoot themselves in the foot. For a "heavy duty" language, it has nothing to offer over its competition (be it Python or Ruby), and is generally more clunky even at what it does.

  119. Re:PHP port of that database code by Anonymous Coward · · Score: 0

    magic_quotes_gpc is off by default in the recommended php.ini file, however is on in the .dist ini file.

    In PHP you can do things like this...

    $stmt = $mysqli->prepare('SELECT foo FROM bar WHERE id = ?');
    $stmt->bind_param('i', $id);
    $stmt->execute();

    no quoting there.

    register_globals has been off by default for a very very long time.

  120. Re:PHP port of that database code by vadim_t · · Score: 1

    magic_quotes_gpc is off by default in the recommended php.ini file, however is on in the .dist ini file.


    Which is one of the problems. Why the heck is stuff like that in an .ini file?

    In Perl, you do things like:

    #!/usr/bin/perl -w
    use strict; # Strict mode, require variable declarations, etc
    use CGI; # CGI functions
     
    # Create new CGI object
    my $q = new CGI();
     
    # Import arguments into 'Args' namespace
    $q->import_names('Args');
     
    # Print
    print $Args::foo;
    This way you don't need to worry whether it's enabled or not enabled in some .ini file. If your script needs it, you enable it in the script.


    In PHP you can do things like this...

    $stmt = $mysqli->prepare('SELECT foo FROM bar WHERE id = ?');
    $stmt->bind_param('i', $id);
    $stmt->execute();


    That's exactly how it should be. Now, why does it seem that most PHP software doesn't use it?
  121. Inexperienced developers, & PHP by Anonymous Coward · · Score: 0

    I would like to comment on that statement. Developers or novice class users know something about using that many don't. If you go along with your system and usage history by staying consistent as never wanting to learn all the fancy stiff in program languages and a few other secrete things that I can't tell you. The system it self gives you free programs. If you really work at developing then you discover free software magically appears on your system. With the day you open it as it property, It's like a gift. That is a secrete to why we keep at it. The free stiff we magically receive You also get special icons that no one else has and advanced functions that no one else has. Oh WELL.

  122. Chinese go for PHP, renounce Ruby/Rails by imkow · · Score: 0, Troll

    A simple reason: ruby was laid out by a japanese...

    it's a fact..

    --
    China, in fact, is very fragile.
    1. Re:Chinese go for PHP, renounce Ruby/Rails by SimHacker · · Score: 1
      A simple reason: ruby was laid out by a japanese... it's a fact..

      You mean Chinese base their choice of programming languages on racial prejudice instead of technological merit??!

      Speak for yourself! All Chinese can't be that stupid. But at least now we know the real reason you're so fixated on PHP and refuse to consider the alternatives.

      So do you think Nazi Germans should hate PHP because it was "laid out" by a Jew? Do you refuse to use Python because you hate the Dutch?

      -Don

      --
      Take a look and feel free: http://www.PieMenu.com
    2. Re:Chinese go for PHP, renounce Ruby/Rails by imkow · · Score: 1

      nobody really refuse anything, they choose their tool for the real world usage..
      i dont use python in my work, because reason one, it's hard to tune it for websites, reason two: my college dont know how to code it to meet the need. Reason 3, is it stable for company~? reason 4, we dont have much time.
      anyway i like python, but not for webpages.
      your teacher back in school must have told you use the right tool for the right job.

      ps: and for the fact i dont use ruby , it's a fact. i think no people in china will be pround to say he knows rudy programming as you do. Ruby community remains in very small scale, not like those of php or python. also as you said, there are many alternatives to ruby. PHP also has its own Rails-like frameworks.

      --
      China, in fact, is very fragile.
    3. Re:Chinese go for PHP, renounce Ruby/Rails by SimHacker · · Score: 1

      I think it's pretty ridiculous that your first reason for not using Ruby is that you're racially prejudiced against Japanese. That's not only bigoted, but also extremely foolish and self-defeating. Many Japanese and other people are laughing their asses off at you, enjoying the fruits of Ruby that you won't eat simply because you're a nationalistic racist bigot. Ruby totally kicks PHP's ass, but you're stuck with the inferior language because you're a racist, and a prisoner of your own mind. I hope most Chinese are not as close-minded as you are.

      -Don

      --
      Take a look and feel free: http://www.PieMenu.com
  123. Re:Question from a .NET developer trying to go OSS by oc255 · · Score: 1

    I hear you on $this way Perl does OO, I don't like the syntax, not that it matters.

    I no doubt believe that slashdotters fall outside of my comments, I'm really talking about the daycoders who don't care about the tech. These people I know don't read /., they just pay the bills writing [technology name].

  124. Re:Question from a .NET developer trying to go OSS by I+Like+Pudding · · Score: 1
    Oh good, positional arguments. Who decides the order?

    Whee, more bashing. The developer decides the order when they call set_primary_keys.

    They're not positional in the database...

    Yes, they are. A "select * from ..." always returns columns in the same default ordering.

    The internals of Perl are old. Over the years, they've come to be fairly full-featured and quite speedy... but they're 10 years old. Any piece of software that organically grows for 10 years is going to become a maintenance nightmare, and that's the state of perl right now. Hence it's time for a rewrite.

    So, it isn't technologically superior, then. You don't throw superior technology out and replace it with new tech borrowing all sorts of ideas from your competitors.

    Lastly, why is any of this stuff an "OOPS"?

    The "OOPS" was directed at your statement of Perl's superiority in relation to it being thrown out and rewritten. Obliquely stated, sorry.
  125. Re:Lemme guess... MySQL is also the best database? by genooma · · Score: 2, Interesting

    Oh yea, it took them 5 mayor versions to set up reasonable database access, obviously PHP is the pinnacle of design and security.

  126. Re:Lemme guess... MySQL is also the best database? by budgenator · · Score: 1

    One unusual gotcha with MDB2 is when it returns a query result as an associate array, it converts the field name indexes to lower case. I think this is because MySQL isn't case-sensitive for field names, just table name, but at any rate it isn't documented and is unexpected as most other oo db interfaces at least fake case sensitivity in field names! If you know how to get the last inserted Id I'd appreciate a shout

    --
    Apocalypse Cancelled, Sorry, No Ticket Refunds
  127. PHP isn't so bad.. by Anonymous Coward · · Score: 0

    My Real(tm) jobs have always been building large scale websites using Java/C++ and sometimes a bit of Perl thrown in. Those technologies no doubt work (though I've managed to escape the J2EE mess) and are more capable. However, there is a certain class of applications where PHP really can't be beat.

    And by and large, most casual websites fall into that class. Want a simple blog and image gallery? Hard to do it quicker than PHP. The main plus to PHP is that its easy for anybody who knows Perl or C to pick up, it's interpreted and generally does what you need it to. No, it's not pretty, or particularly maintainable, but for most little projects, it's the fastest way to get things done and is good enough.

    Just as Perl is awesome for doing quick text manipulations, PHP is great for doing quick websites.

    As for security holes, I'd agree with others, it really doesn't seem intrinsic to the language. I've run various websites written entirely PHP for the better part of 5 years without a single exploit. You just have to be reasonably clueful and check your inputs, as you would in any language.

    PHP probably gets a bad name because its the easiest of all languages to create dynamic content in. PHP is almost always included with hosting packages, and anybody can start putting in some <?'s and get to work. It's no easier to write exploitable code than C, it just happens to automatically be on the network, so it is automatically vulnerable.

    I've recently started playing with Cake, a Rails like framework for PHP and so far I like what I see. Will have to dig into its internals a bit before I trust it fully from a security point of view, but it combines the best of PHP (speed, ease of deployment) with solid design patterns. Again, I wouldn't pick it for a big project, but for everything else it's awesome.

    -Nic

  128. Re:Lemme guess... MySQL is also the best database? by Anonymous Coward · · Score: 0

    Except in large scale applications (and sometimes even small ones) PDO adds too much overhead and becomes a bottleneck.

  129. Main cause of insecure PHP software by DamienMcKenna · · Score: 1

    From my experience the main cause of insecure PHP software is developers not turning the error validation to the highest during development, so when an unsuspecting user downloads the software little do they know that their system can and often is wide open to stupid bugs and security problems. When you leave error_reporting to the default setting you miss lots of important details, like array keys being passed as constants, variables being referenced before they're created (especially with arrays), incorrect return types, etc, etc, yet people wonder why their code is so buggy? I was installing vtiger, which is a pretty comprehensive CRM that has lots of potential to hit it big, the other night for a client and was slamming my had against the wall at the sheer number of stupid syntax bugs that were in the system.

    How many programs out there tell you to turn on the old register_globals that everyone knew was a huge security problem?

    How many programs tell you to turn down the error_reporting level to hide their development incompetence?

    I was actually considering starting a movement to have the PHP community clean up their act, we'll see if its still needed after the dust settles from this.

    Personally I think that with PHP 5.2 they should have stopped supporting deprecated coding practices, like accepting invalid variables and invalid array keys, so that this stupidity could finally stop.

    That's why I don't do much with PHP anymore, a large portion of the open source projects that clients want you to "make work" are riddled with utterly stupid mistakes that you spend days if not weeks cleaning it up before you can actually start doing any work.

    Damien

  130. Re:Lemme guess... MySQL is also the best database? by laffer1 · · Score: 1

    Well remember the current Zend people took the work of someone else in PERL and created PHP 3 and on. It started as a PERL library to ease CGI development.

    I can't believe they still haven't caught up to the ease of use of ASP. (not .NET, but classic ASP) Microsoft did a great job of keeping the API constant and offering a fair amount of security for the time. If PHP won't be secure, it could at least be consistent. Why can't the open source community make something like ASP? Many people using PHP are hobbyists and things could get much easier for them. And before anyone posts that the API stays the same, look at the changelog for PHP sometime.

  131. Re:Question from a .NET developer trying to go OSS by Anonymous Coward · · Score: 0
    Oh good, positional arguments. Who decides the order?
    Whee, more bashing. The developer decides the order when they call set_primary_keys.
    And then the developer has to remember the right order, every time he calls ModelName.find: indecipherable and very error-prone. What a shit!
  132. PHP & Bikes by shoolz · · Score: 1

    My son fell off his bike and skinned his knee, so I bought him knee pads. Then he fell off his bike again and skinned his elbow, so I bought him elbow pads. He fell off and got a rock in his hand, so I bought him gloves and wrist guards. He then fell over in the park and got a goose-egg, so I bought him a helmet. Then he ran into a tree so I bought him a suit of body armor.

    Now he has so much protection that he couldn't possibly hurt himself right?

    What's that you say??? Give him lessons on how to ride his bike? Holy shit! I never thought of that!

    To all those who say that PHP is weak because it doesn't protect the developer... I say you don't understand PHP or development very well at all.

  133. Read books, don't code? by Slashdot+Parent · · Score: 1

    I recommend not letting whiny slashdot posters make your technology choices for you.

    If you keep reading more and more books, you'll never actually create anything. I say pick your simplest web project and take a stab at it using whatever technology you think you can pull it off in. You'll learn a lot from the experience, and then you can decide if you want to learn a whole new language.

    If you listen to slashdot, you're going to be using Ruby on Rails, Postgresql, and no <table> tags. If you did that would you be using superior technology? Yes, you would be. But by the time you learn RoR (and OOAD and ActiveRecord and MVC and...) and Postgresql, you could have implemented 3 web projects in PHP/MySQL.

    I'd advise you to use PHP/MySQL until they no longer meet your needs. Then, learn something else.

    --
    They don't grade fathers, but if your daughter's a stripper, you fucked up. --Chris Rock
  134. Python's SQLAlchemy rocks! by SimHacker · · Score: 1

    Since you're wise enough to dump PHP and switch to Python, and you're looking for a good way to do SQL, then you should definitely check out SQLAlchema. It's light years ahead of Ruby's "ActiveRecord", plus it has several different front-ends that simplify it and make it as easy to use as Ruby's ActiveRecord and Python's SQLObject, while still allowing you to use its much more advanced features.

    Not only is it much more powerful than Ruby's ActiveRecord (which is causing people to abandon PHP in droves), but SQLAlchemy is astronomically better than anything PHP has, and PHP will never have anything that even approaches ActiveRecord because of foolish bugs and design flaws that the charlitans on the PHP team stubbornly refuse to fix. (As described in detail in Zend's ZActiveRecord Boondoggle.)

    -Don

    SQLAlchemy: The Python SQL Toolkit and Object Relational Mapper

    SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL.

    It provides a full suite of well known enterprise-level persistence patterns, designed for efficient and high-performing database access, adapted into a simple and Pythonic domain language.

    SQLALCHEMY'S PHILOSOPHY

    SQL databases behave less and less like object collections the more size and performance start to matter; object collections behave less and less like tables and rows the more abstraction starts to matter. SQLAlchemy aims to accommodate both of these principles.

    SQLAlchemy doesn't view databases as just collections of tables; it sees them as relational algebra engines. Its object relational mapper enables classes to be mapped against the database in more than one way. SQL constructs don't just select from just tables--you can also select from joins, subqueries, and unions. Thus database relationships and domain object models can be cleanly decoupled from the beginning, allowing both sides to develop to their full potential.

    Scales Up

    Powerful enough for complicated tasks, such as:

    * Eager-load a graph of objects and their dependencies via joins
    * Map recursive adjacency structures automatically
    * Map objects to not just tables but to any arbitrary join or select statement
    * Combine multiple tables together to load whole sets of otherwise unrelated objects from a single result set
    * Commit entire graphs of object changes in one step

    Scales Down

    Extremely easy to use for all the basic tasks, such as:

    * Constructing SQL from Python expressions
    * Pooling database connections
    * Loading objects from the database and saving changes back

    DBA Approved

    Built to conform to what DBAs demand, including the ability to swap out generated SQL with hand-optimized statements, full usage of bind parameters for all literal values, fully transactionalized and batched database writes using the Unit of Work pattern.

    Highly Modular

    Different parts of SQLAlchemy can be used independently of the rest. You can use the connection pool by itself and deal with raw connections; or you can use the SQL construction language by itself, either in direct conjunction with one or more database connections or as standalone constructs which return their string-compiled contents. While SQLAlchemy has a great ORM provided, the other parts have no dependency on it; its usage is completely optional. Simpler facades for the ORM can be used as well, such as the ActiveMapper and SqlSoup extension modules. SQLAlchemy is architected in an open style that allows plenty of customization, supporting user-defined datatypes, custom SQL extensions, and a plugin system which can augment or extend any functionality including SQL expressions an

    --
    Take a look and feel free: http://www.PieMenu.com
    1. Re:Python's SQLAlchemy rocks! by DoktorTomoe · · Score: 1

      Thanks for the tip, this seems really useful...

  135. AGREE, they dont code PHP, they judge it by rumor by imkow · · Score: 1

    one who really code php seriously will soon find the flexibility, the extensibility, the ease of the language! that's one of reasons why they are so many web application written in php.

    --
    China, in fact, is very fragile.
  136. Zend's ZActiveRecord Boondoggle by SimHacker · · Score: 1

    [I posted this earlier in the context of PostgreSQL Slammed by PHP Creator, but it bears repeating, since the charlitans at Zend still haven't addressed the problem, and NEVER WILL. Would anyone from Zend please finally comment, and explain just how PHP's plan for a database solution is better and more secure than Python's SQLAlchemy? -Don]

    The creators of PHP are morons, and their support company Zend is dishonest and incompetent. The ZActiveRecord boondoggle demonstrates exactly what I mean: They can't program their way out of a paper bag, an don't even understand the limitations of the very language that they haphazardly "designed".

    It makes me laugh that Lerdorf would slam Postgres, because the PHP designers have no understanding of object oriented programming or databases: instead they invent half baked cargo-cult designs, which are naive reactions to other systems they don't understand: they try to ape their surface features without understanding the reasons behind the way they're designed.

    PHP references were thrown in as a band-aid to work around the horrible design flaw that arrays and objects were foolishly DEEP COPIED by default. If you pass or return an array from function to function, its contents are DEEP COPIED, which is EXTREMELY inefficient and leads to all kinds of horrible bugs because it's the last thing a sane programmer would expect. So instead of fixing the design flaw in PHP, they add "references" that LOOK and SOUND like C++ references, but actually are completely different, again misleading programmers into thinking they understand what's going on, but working totally differently than a sane person would expect. PHP references are actually half baked symbol table references. The sloppy implementation caused many bugs that CORE DUMP PHP! PHP references were so poorly thought out and badly designed, that there were many edge conditions that they hadn't considered, that simply didn't work together, caused memory leaks and core dumps, and had useless and confusing semantics: callers passing references, functions declaring that they take references, functions returning references, etc. Compare that to C++'s simple and consistent definition of references in term of pointers. The only way to make a PHP reference to an object is to put it in a variable -- you can't make a reference to a field of an object or the return value of a function without storing it in a temporary variable -- totally unlike C++, and totally stupid.

    PHP's object oriented programming system is a half-baked imitation of C++'s object model, haphazardly designed by charlitans who had no clue about the fundamentals of object oriented programming, elegant language design or efficient implementation. First of all, if you're going to try to imitate an existing design without understanding it, then for god's sake, at least imitate a language whose object system doesn't suck, and a language that has similar semantics to the language you're trying to kludge. C++ is a static compiled language, and its object system deeply reflects that fact. (That is to say, there's very little reflection beyond RTTI, because the compiler throws all the interesting stuff away! And C++'s oop design had to make many horrible compromises because the C++ object system was designed to map directly into C se

    --
    Take a look and feel free: http://www.PieMenu.com
    1. Re:Zend's ZActiveRecord Boondoggle by Anonymous Coward · · Score: 0

      thank god i stopped reading after 2 paragraphs..

      funny how you run drupal which is a php based management system on your homepage and yet you flame it to hell.. why not take that down and run a nice, "better language" ?

    2. Re:Zend's ZActiveRecord Boondoggle by SimHacker · · Score: 1

      If I didn't use and program in php, then I wouldn't know first hand what was so horrible about it. You're not qualified to complain about a language (or anything else) if you don't know what's wrong with it from first hand experience.

      Back to the discussion: So which database interface do you use in PHP, and how is it better and more secure than SQLAlchemy or ActiveRecord?

      -Don

      --
      Take a look and feel free: http://www.PieMenu.com
  137. PHP: Ought to stick a fork in it, it's done. by SimHacker · · Score: 1
    --
    Take a look and feel free: http://www.PieMenu.com
  138. Re:Question from a .NET developer trying to go OSS by Anonymous Coward · · Score: 0

    PHP is used on big sites because it's fast. Period. With a good bytecode cache, nothing else even comes close.

  139. Re:Question from a .NET developer trying to go OSS by masklinn · · Score: 1

    I agree that PHP has problems that make it easy for non-experts to leave their scripts wide open, and create terrible, kludgey code;

    Worse than "easy", trivial, and most documentations head you towards crappy code hell.

    but that does not somehow make it impossible to write good code in PHP.

    Of course not, just as you can write Fortran in any language, you can write good code in any language (except BrainFuck or Moo, I guess). The thing is, PHP makes it far harder than necessary, and you'll always feel the nudge to "just do a quick fix here", and if you do, everything gows downhill. Fast.

    It's a flexible language compared to Java

    That's kind-of like saying that something is warmer than liquid nitrogen. It's true, but it's not really hard if you try, and many other things are.

    but that doesn't mean that good code somehow cannot be written in it.

    Still makes it far harder than some other languages out there that are much more flexible, complete, enjoyable, clean, and full featured.

    --
    "The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
  140. Re:php is the best language still by Divebus · · Score: 1

    He may really have meant "ingineering"

    --

    Most of the stuff on /. won't survive first contact with facts.
  141. Re:Lemme guess... MySQL is also the best database? by DragonWriter · · Score: 1
    If there are bugs in CMS's (or whatever) written in PHP, then those (professional) programmers made errors. You really don't ... go blaming your tools. You chose them.


    That's often said, but its misleading and somewhat of a false dichotomy.

    Sometimes the mistake you made was choosing the wrong tool, and its perfectly valid to point to the defects of the tool relative to the use in explaining why that is so, even if (of course) all mistakes belong to some human at some point in time, not to a tool.

    If someone wrecks my computer because they tried to open the case with a sledgehammer rather than a screwdriver, I think its right to point to the choice of tool as a central part of their error. That's not "blaming the tool", that's just identifying the problem. Likewise, if people use PHP for a purpose for which that language is ill-suited because of its set of features and bugs, and consequently produce insecure applications or ones with other systematic problems, then pointing out why the language is not a good choice for that use isn't "blaming the tool", its just identifying the problem.
  142. Re:Question from a .NET developer trying to go OSS by masklinn · · Score: 1
    That's actually wrong, truth are that
    • It's not that PHP's fast with a bytecode cache, it's that PHP is damned slow without it
    • Django/mod_python beats the crap out of most PHP stuff
    • And I strongly doubt Django's the fastest framework out there (in terms of raw speed, it also beats PHP in security and speed of development by the way). Seaside (+ Strongtalk?) looks mighty fast for example.
    --
    "The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
  143. Re:Lemme guess... MySQL is also the best database? by Anonymous Coward · · Score: 0
    I'm the AC poster of the original comment. Posted AC mostly because I recognise that my info may have been out-of-date.

    I only ever wrote one PHP website myself, but I've had the occasional brush with it with LAMP applications.

    The example popular PHP applications I was thinking of were Wordpress, where keeping ahead of the security holes seems a never-ending job, and perhaps Mambo/Joomla.

    Nevertheless that's good news that PHP5 supports bound parameters. Now if only all developers took some notice of that and start to use it.

  144. Re:Lemme guess... MySQL is also the best database? by kiwigrant · · Score: 0
    Use of placeholders ('?') and bound parameters is a must for secure SQL, but PHP doesn't support them ...

    This statement is not correct. The mysqli extension (PHP5+ and MySQL 4.1+) allows parameter binding and it has been available for a couple of years. E.g. $stmt = $mysqli->prepare("INSERT INTO CountryLanguage VALUES (?, ?, ?, ?)");

    PDO has already been mentioned, but the following is worth noting:

    Prepared statements are so useful that they are the only feature that PDO will emulate for drivers that don't support them. This ensures that you will be able to use the same data access paradigm regardless of the capabilities of the database (http://nz.php.net/pdo)

    Of course, it is one thing to provide developers with more secure ways of doing things - it is another to compel them to use such methods. Some of the changes in PHP6 look promising in this regard but it is probably good to keep up the pressure for security-oriented design.

  145. Harder doesn't mean hard. by Generic+Player · · Score: 1

    Yes, every shitty $3 host has php/mysql. While it is harder to type "rails hosting" into google, its still a far cry from hard.

  146. Re:php certainly is the best language... by Anonymous Coward · · Score: 0

    It was not supposed to be insightful, informative, interesting, a troll, or flamebait. It was supposed to a [bad] joke.

    Though I'm hardly surprised that people wasted their mod points on it.

  147. Re:PHP port of that database code by Snwbeast · · Score: 1

    That also assumes you are using the new mysql driver code in PHP 5. My web host still has PHP 4.x, so no, I cannot do what you just showed. Not to mention that's not particularly portable for other databases, with Perl and DBI you just change the DBD driver and keep using the same code...

  148. Re:Question from a .NET developer trying to go OSS by jrockway · · Score: 1

    > So, it isn't technologically superior, then. You don't throw superior technology out and replace it with new tech borrowing all sorts of ideas from your competitors.

    Well, it has the largest collection of good ideas in one place. Perl6's collection will be larger. That's not to say Lisp or Haskell or Ruby or Python has a small collection, though.

    --
    My other car is first.
  149. Look it just works . . . by ejp · · Score: 0

    Client: I need a youtube like thing, needs tags, searching, image manipulation, database, membership, and more.

    Using PHP? 90% completed in a weekend. There is just no language this easy to prototype in. Fine do it in jsp, if you have the bucks. Model it then in PHP. Just the way it goes. PHP 5+? Looks like a pretty solid language to me.

    Wikipedia, osCommerce, Drupal, Joomla, and more. IT JUST WORKS! :-)

  150. "PHP has been implemented in a very unsafe way" by SimHacker · · Score: 1

    The article says:

    It is not the case, however, that the PHP project is trying to conceal the fact that PHP has been implemented in a very unsafe way.

    Parse that carefully. It says the PHP project is not trying to conceal the fact. What fact? The fact that PHP has been implemented in a very unsafe way.

    Oh, that fact. Yes, it's a pesky little fact, indeed. But the fact that they're arguing about whether or not they're trying to conceal it, instead of arguing about how to best address that inconvenient little truth, is a big problem.

    PHP's implementation is unsafe, fundamentally flawed, insecure, and it's badly designed to its very core. That's a fact. Any apologist who counters "but it gets the job done" is ignorant of PHP's problems, and ignoring the fact that there are many other open source languages out there that are much better designed, also get the job done, are at least as easy to learn and use as PHP, without all the bugs and security holes, and with many important advantages.

    There's no reason to be using PHP to write new software, except ignorance of other languages and refusal to learn.

    -Don

    --
    Take a look and feel free: http://www.PieMenu.com
  151. Re:Question from a .NET developer trying to go OSS by Anonymous Coward · · Score: 0

    del.icio.us uses Perl+Mason. Do leave that out.

  152. Re:If people used my butt to the extent they use p by unity100 · · Score: 1

    It is easy to understand that how any post saying anything against java gets moderated down like hell.

    being 'most extensively used commercial' is WAY down in scala from being 'most extensively used'. some corporations use java, but everyone uses php.

  153. PHP forces you to write bad code. by SimHacker · · Score: 1

    PHP can't force to to write good code, but it certainly forces you to write bad code.

    Case in point: Zend's ZActiveRecord Boondoggle. PHP's object model is so broken that it can't support an ORM as simple and easy to use as Ruby's ActiveRecord, let alone one as powerful and flexible as Python's SQLAlchemy.

    How do PHP's "numerous other data abstraction layers" compare to ActiveRecord and SQLAlchemy? Why can't Zend themself figure out how to implement their own version of ActiveRecord? It's because a fatal flaw in the design of the PHP language, that's why.

    It's no wonder so many people are abandoning PHP for better languages like Ruby and Python.

    -Don

    --
    Take a look and feel free: http://www.PieMenu.com
  154. an unwise comparison by imkow · · Score: 1

    It's at least unwise to compare php with C++. PHP is a glue for powerful C++ libraries, it's based on C/C++. it's like a son of C++. so is any one of those 3Ps(Perl,Python,PHP). they cant live without C++. PHP is a helper to C in making webpages. it would be also unwise to use php coding something like OS or compiler. but if on websites/browser-server, php rules!

    --
    China, in fact, is very fragile.
    1. Re:an unwise comparison by SimHacker · · Score: 1

      Wrong: PHP, Perl and Python and Java are all written in C, not C++. Do you know ANY other language than PHP? If not, you're just ignorant: why do you think your opinion matters?

      You're also wrong that PHP rules on "website/browser-server". First of all, nobody runs PHP in the browser. Second of all, PHP doesn't rule on the server: it totally sucks compared to the alternatives.

      Compare PHP to other languages like Python, Perl, Java and Ruby: it's much worse, buggier, and poorly designed compared to all the alternatives.

      If you really think PHP doesn't suck, then please explain which database interface you use in PHP, and how it compares to SQLAlchemy and ActiveRecord in terms of power, security, flexability, ease of use, and performance. That's my point: PHP totally sucks in comparison to the alternatives, and its majorly fucked up design flaws and broken object model make it impossible to do anything in PHP like the popular and powerful ActiveRecord and SQLAlchemy do.

      While you're at it, please explain why you believe that PHP's object model is not totally fucked up, and justify its bugs and limitations with respect static methods as I described above, explain why the PHP team refuses to fix those design flaws, and demonstrate how you'd work around those flaws to write an ActiveRecord-like ORM, the way Zend attempted to do but miserably failed. Maybe you can teach the charlitans at Zend a thing or two, if you're such a hot PHP expert.

      -Don

      --
      Take a look and feel free: http://www.PieMenu.com
    2. Re:an unwise comparison by imkow · · Score: 1

      unfortunately, i have learnt all those languages in a certain degree.~ therefore i can tell you why php has its place. it's probadly just you who ignores the fact there is so much good and convenient PHP have brought to the millions of people. you might just blind by your narrow sight following the so-called prefect design.
      if PHP were evil as your viewpoint, so tell those people who know nothing about computer, that how can they code a website within 1 week without pain, tell those people like me how to start a host/server farm with Java/python without security compromise? how do i make python fast and stable enough to carry out a portal website, better doing it easier than php?because we dont have time to mess around with machine all days.

      as for database interface, i have tens of choices with php, i can do with ADODB,PDO,ODBC, or i can wrap my own class. there are also tens of frameworks to help me get the job done. good enough....it's stupid to ask for an exact same interface of another language... the world is not unifed yet! have you really coded multi-dasebase program before? if you had,i doudt if its 100 percent database independant. prove it.

      object under php5 is no longer copied but referenced when pass it to another variable. i wonder if this is what you complaining about.. in this case you would learn deeper about php.

      also zend framework is not a part of php. it's just one of frameworks. if you messed up with it. dont blame php.. some hyper-advanced feature is optional when it comes to websites. personally i prefer to use those original ported C API when coding my personal pages, it's faster!~i dont want cross-basebase.

      after all i have to tell you, php is a language that's been evolved to current status. people adopted it mainly because of its convenience. get to the real world you will find a lot beautful things have flews. so is my english. it's not the language which sucks,it's I the person who dont know it well.

      --
      China, in fact, is very fragile.
  155. Re:Question from a .NET developer trying to go OSS by discojohnson · · Score: 1

    ...automatic taint checking...

    please don't use the words "Rails" and "taint checking" in the same paragraph; some of use would rather you not check their taint with anything for that matter.

  156. Re:If people used my butt to the extent they use p by SimHacker · · Score: 1
    It is easy to understand that how any post saying anything against java gets moderated down like hell.

    Ahem -- REALITY CHECK: YOUR stupid PHP-fanboy post was moderated -1 Troll, and the pro-Java, pro-Apache post was moderated +1 Interesting.

    Please explain why you think -1 > 1? Is there some quirk in PHP's numeric handling, type conversion, identity and comparison operators that has you confused about the order of integers?

    You're the worst kind of PHP apologist, with your reality-denying Rumsfeldian arguments. The whole point of this discussion is the PHP developer's stubborn refusal to address security issues, and their consistent mis-behavior of sweeping problems under the rug and refusing to fix bugs. The fact that PHP is widely used makes it EVEN MORE IMPORTANT to fix its bugs and design flaws. But as your twisted argument goes, PHP's popularity is an EXCUSE for having so many bugs and design flaws. Blame the media for the casualties in Iraq, why don't you?

    Nobody's arguing about whether or not PHP is buggy and badly designed. That's simply an undisputed fact. But you're trying to claim its outrageous number of bugs and design flaws is OK because PHP is widely used, and that's totally ridiculous, and outright negligent.

    -Don

    --
    Take a look and feel free: http://www.PieMenu.com
  157. Re:If people used my butt to the extent they use p by SimHacker · · Score: 1

    By the way, your amazing image resizer web service that you advertise in your link has some wee bugs. Wow, that's some really amazing powerful PHP code you wrote there, which really demonstrates your mastery of PHP, and shows how much better PHP is than any other language. There's no way anyone could have done that in any language besides PHP, because PHP is just so powerful and easy to use, when it comes to resizing images. You must have to pay a lot in web hosting fees to run such a sophisticated web service. Have you already received thousands of dollars in PayPal donations from your amazing service, or sold your great online image resizing idea to Kleiner Perkins as the next big Web 2.0 startup company?

    Warning: Division by zero in /home/imageuti/public_html/index.php on line 108
    Warning: imagecreatetruecolor(): Invalid image dimensions in /home/imageuti/public_html/index.php on line 122
    Warning: imagecreatefromgif(): '/tmp/phpu5sGOq' is not a valid GIF file in /home/imageuti/public_html/index.php on line 125
    Warning: imagecopyresized(): supplied argument is not a valid Image resource in /home/imageuti/public_html/index.php on line 129
    Warning: Cannot modify header information - headers already sent by (output started at /home/imageuti/public_html/index.php:108) in /home/imageuti/public_html/index.php on line 132
    Warning: Cannot modify header information - headers already sent by (output started at /home/imageuti/public_html/index.php:108) in /home/imageuti/public_html/index.php on line 133
    Warning: imagejpeg(): supplied argument is not a valid Image resource in /home/imageuti/public_html/index.php on line 135

    -Don

    --
    Take a look and feel free: http://www.PieMenu.com
  158. Re:If people used my butt to the extent they use p by SimHacker · · Score: 1

    Another point about your buggy image resizer web page: Your disclaimer is a lie!

    We do not store, copy or use the images processed through this site by any means - your image is piped from the '$_POST' variable directly to a function that processes and outputs it to download.

    Then how do you explain this error message:

    Warning: imagecreatefromgif(): '/tmp/phpu5sGOq' is not a valid GIF file in /home/imageuti/public_html/index.php on line 125

    Is it just my impression, or are most PHP apologists really as incompetent as you?

    -Don

    --
    Take a look and feel free: http://www.PieMenu.com
  159. Re:AGREE, they dont code PHP, they judge it by rum by SimHacker · · Score: 1

    Are you trying to deny that other languages like Python and Ruby are flexible, extensible and easy to use? In fact, they're much more flexible, extensible and easier to use than PHP, by a long shot.

    There's nothing special about PHP that doesn't apply to other languages, and you can't deny that PHP is severely flawed in its own peculiar ways.

    I'm not judging PHP by rumor, nor trying to compare it to other languages I don't know. Anyone with enough perspective to compare PHP with other languages can understand and admit to PHP's limitations. Why can't you? Is PHP the first and only language you ever learned? If you had anything decent to compare it with, you would realize how bad PHP sucks in comparison to the alternatives.

    -Don

    --
    Take a look and feel free: http://www.PieMenu.com
  160. Fantastic find ! by unity100 · · Score: 1

    Yes indeed you have found some mishaps in a code that was produced during one afternoon's tea for curiousity.

    Well done !!!

    Why THAT much hate towards php, and trying THAT hard to demean it ? im really asking.

  161. Oh yes we are caught. What are we gonna do ! by unity100 · · Score: 1

    Oh but wait. Maybe ALL uploads end up as temporary files and deleted when processing ? Kinda as it happens in all uploads around the net ? Maybe we should establish a ram cache and process the images in there shouldnt we ? hmmmm but then that again would mean that files are then would be SAVED in the ram cache eh ?

    Well what i think is that you seem like you are on a witch hunt. Much annoying, and contrary to what you think, goes far to prove my point than to prove yours.

    1. Re:Oh yes we are caught. What are we gonna do ! by SimHacker · · Score: 1

      Python has a form handling library that does not store uploads in the file system, and so does Java. Why can't PHP do that?

      You specifically stated that "We do not store, copy or use the images processed through this site by any means - your image is piped from the '$_POST' variable directly to a function that processes and outputs it to download." You're wrong, because you are writing the file to disk, and you didn't even know it (or you lied on purpose).

      My point is that many PHP programmers have no idea what their code is doing, because they don't understand the language or its libraries. And that many PHP programmers are extremely lazy and sloppy, and write such crappy code that they don't bother to check their input parameters. And you've illustrated it perfectly.

      -Don

      --
      Take a look and feel free: http://www.PieMenu.com
  162. well here is what i think by unity100 · · Score: 1

    actually ANYTHING that says anything against java or praises php is moderated down like hell all around slashdot, in case you havent noticed. causes might be numerous, but in any case it is something that is very detrimental to developer community and proves that there are more zealots than professionals around here. so i knew that that post would be modded down speedily right at the start by some java fanboy so that noone should read it - just like microsoft stuff.

    Also, based upon the 2-3 hateful posts you have made in reply to my post, i have come to know your nick as representing a person that is aggressive, annoying, uncivil in manners and also a zealot of sorts.

    So if you please, i wont be replying to your future comments here, as i dont like this lowly type of 'discussion' which is in fact little more than aggressive bickering.

  163. Very interesting by unity100 · · Score: 1

    Almost ALL stuff we use in our modern world holds on to the information for at least a while.

    Even when with the tv, the received transmission spends a few miliseconds before finally arriving at the crt and lighting up the screen.

    As per your argument, even this legally should be a copyright infringement - as your device holds on to the copyrighted material even for a matter of a few miliseconds. However we all accept that it is not so, as it is the workings of the machine neccessitates it, and the device owner is not able to abuse this a few seconds delay to his/her own profit.

    You say python and java does not store the image in a saved file eh. Where they are doing the operation on the received image then ? In limbo ? They are using the memory to do it, the least. In ANY case, the image will spend some time in the server's ram. A few miliseconds, nay, probably a little higher. What does image upload function for php do ? get the file uploaded, which, you will have to wait until the upload is complete, and at that moment it is complete reprocess and stream it back, and delete the file. How long does it take ? 1 seconds ? 1.5 ? Whats the difference in holding a file for 0.5 seconds or 1.5 seconds for processing ? The 'saving' part confuses you ? Saving to disk ? What happens when on a python or java server the memory is full, and the uploaded file ends in swap file instead of memory ? Whats the difference ?

    But eh. I cant know this, since i dont know how my script works. Sorry to bother you.

    1. Re:Very interesting by SimHacker · · Score: 1

      Hey, YOU are the one who wrote the strongly worded disclaimer that says "We do not store, copy or use the images processed through this site by any means - your image is piped from the '$_POST' variable directly to a function that processes and outputs it to download." (emphasis mine, but the words are totally yours)

      So now you have flip-flopped and are arguing that "Almost ALL stuff we use in our modern world holds on to the information for at least a while." So that means that you were a liar when you wrote the disclaimer. You can't have it both ways.

      Why did you bother writing such a strongly worded yet misleading disclaimer, if you knew that the uploaded files would be stored on disk? Or did you not even know that until I pointed it out to you by showing you the error messages?

      When you store a file on disk, the data stays around for much longer than it would have if it were only held in memory. You should know that. Or is that a big surprize to you too? Are all PHP programmers as ignorant as you are? I suspect so.

      -Don

      --
      Take a look and feel free: http://www.PieMenu.com
    2. Re:Very interesting by unity100 · · Score: 1

      Heres some tips for you :

      First, be civil, kind and polite in your correspondence. From your speech, you are trying to demean insult and belittle the opposing faction more than you provide arguments for your case.

      Second, if you are not able to realise what is legally important or not, and courts take cases in confines of applicable reason, not fantastic arguments, dont speak about it.

      The issue at hand is whether anything done there is LEGALLY right, or wrong. And in legal terms, its no more harmful than your satellite receiver, your dvr, pvr or whatever. I see that you got that point well, but still trying to fight out an argument.

      Not only that but technical-wise you are now instead arguing that using disk as memory cache/storage until processing takes much longer than it is in memory. Well, that is ignorance if anything isnt. On a heavily used server data waits more in swap file.

      What you are doing seems more like an attempt to demean php and php community than arguing a technical issue. With that demeanor of yours, its no wonder that you java (and similar obscure language) people are increasingly becoming outcasts.

      Be civil first.

  164. fake internationalist,u are not selling any good. by imkow · · Score: 1

    live inhe real world, kid. you simply believe ruby is better. grow up, those are just tools. when we(the real website makers) pick tools , we choose the well-supported ones. does ruby has established any better support in popular industry-standard servers like apache, or IIS? or Ruby has shown any superior advantage in performance,stability, or something we stressed here, security? or are there thousands of out-of-box web applications written in Ruby which i can customize into a website within a day?

    nevertheless, after all,
    in technical level, PHP has something convenient enough to Rails(Rails is just a renovated method, not a technology leap). you can learn one of those frameworks if you too weak to code from scatch..

    ps:Chinese hate japanese (not personally)because japanese goverment have never made any formal apology for their wartime atrocity during WWII to us.. how can you such an unidentified homeless cyber-ghost could understand the history of mankind. and it's not your business, go back to your cage!.

    --
    China, in fact, is very fragile.
  165. those who stand behind their work, those who don't by epine · · Score: 1


    Perhaps some of us need to add a line to our license blurb at the top of the source file (not the license itself) stating that: "The author of this code stands behind his/her work and will immediately publish any defect reported in this code" while others can place the line "The author of this code does *not* stand behind his/her work and will *not* publish any defect reported until a very long time after a solution is found, if the code can be fixed at all."

  166. Re:Lemme guess... MySQL is also the best database? by cortana · · Score: 1
    Now if only all developers took some notice of that and start to use it.
    Unfortunately this will never happen. The big projects you mention (that are the source of most of the security flaws) can't migrate to PDO because most providers still only run some ancient version of PHP 4. And the providers won't migrate because there is no need--most applications are still written with PHP 4 in mind...
  167. Re:Lemme guess... MySQL is also the best database? by yfarren · · Score: 1

    umm...pg_query_params()

  168. Such animosity against PHP! by rk · · Score: 1

    I understand some of it. It's not my favorite language, by far, and it is easy to shoot yourself in the foot with it.

    I'm guessing most who bash PHP as a "horrible" programming language have ever been exposed to true crawling horrors like COBOL and RPG. At least PHP has functions with local variables.