Slashdot Mirror


PHP5 Co-Creator Interview

mandozcode writes "I came across an interesting interview with PHP co-creator Zeev Suraski at Open Enterprise Trends on the latest upgrades for PHP5's First Release Candidate (just released a week or so ago). Sounds like lots of improvements to help make it in the enterprise, including better bundled support for SQLlite and XML. Also encouraging, looks like Zend is getting more millions in VC investment."

16 of 53 comments (clear)

  1. PHP's broken security model by Mr.+Darl+McBride · · Score: 3, Interesting
    I can't take PHP seriously for one reason alone: No built in suid mechanism.

    If you enable PHP on your apache server, all PHP runs as the same user. That means any files writable by one PHP script are writable by all PHP scripts. There's no such thing as a secure apache PHP installation unless you run in feature limited mode which breaks virtually all PHP scripts and makes it unusable for most tasks.

    Until PHP adds suid so PHP runs as the user owning the script, it's a no-go. Run in high security mode it's usable as a toy at best, or run in default mode, it's a security nightmare.

    I've spoken with the PHP developers about this at several conferences. Their solution is that you have each user run their own copy of apache or have each user create their own PHP installation and run everything as CGI, launching the local PHP copy. I'm sorry, but that's insane.

    I don't give a lick about new features if you can't get the foundation fixed. Take care of the wet sand base before you up the supported database count or make grand announcements about clever new scripting keywords.

    1. Re:PHP's broken security model by Gislobber · · Score: 3, Informative

      I totally agree with your agrument. A friend and I have been searching for a resolution to this for quite a while.

      Then the other day, I think he may have found our (temporary) savior.

      This module is in development, but looks to be almost *exactly* what we are looking for.
      http://httpd.apache.org/docs-2.0/mod/perchil d.html

    2. Re:PHP's broken security model by Fweeky · · Score: 2, Insightful

      Eh, this is really outside the scope of PHP to fix; it's something for CGI suexec, FastCGI, Apache's perchild MPM, or some other higher level system for web based scripting to deal with.

      If you don't want to take PHP seriously, do so because of it's instability (and poor release engineering), it's lack of speed (which has been partially fixed several times, but hey; Zend need to make their money!), the complete mess it's extensions are in, the inflexibility of the language (again, partially dealt with in Zend 2, but still a world away from some other dynamic languages, with lots held back by the extreme bittersweetness of backwards compatibility, which seems to break a lot anyway), the userbase mostly consisting of programming newbies, the ever-bickering devteam, or any of a thousand other issues you can pick on PHP about.

      But hey, I still use it. Doesn't mean I have to like it.

    3. Re:PHP's broken security model by sumbry · · Score: 3, Insightful

      I can't take PHP seriously for one reason alone: No built in suid mechanism.

      You gotta be kidding, right? I mean this isn't even a concern if you aren't running in a shared hosting environment. Seems a bit premature to toss out an entire programming language that could potentially be beneficial because you don't agree with how it's implemented in one particular situation.

      That said, it is entirely possible to get PHP working w/Apache suExec and to automatically have it execute php scripts as the User/Group specified in an Apache VirtualHost block.

      http://www.localhost.nl/patches/phpsuexec_howto. ht ml

    4. Re:PHP's broken security model by Hungus · · Score: 2, Insightful

      And how are you going to comprimise the scripts? With good implementation none of the user input data is trusted anyways. PHP is sandboxed and will not allow any scripts outside of a particular directory to execute, and on our systems that directory is on read only media to begin with, SO i suppose yes if you break into the colo facilities manage to find my clusters amongst the racks and change out the storage arrays then I am in trouble otherwise I simply don't see it. Obviously I am not going to disclose details of the system in an open forum other than to say it is built fully from open source, and rivals teh largest listed databases in size and to this day has yet to have a breach. Of course it helps that we are always working to improve it and keep things patched too :) )

      You don't like PHP thats fine and dandy. In fact its good because thats why we have a number of diverse languages. However there is no good reason to make such broad sweeping statements, especially when you aren't willing to go on the record as to who you are. I could say things like all windows products suck, but that simply is not true (yes I still like NT3.5x and NT 4 but yu have to know how and where to use them I will stick with my BSD boxes for anything needeing to actually be used). I could say all open source applications are used by terrorists, which would be nearly as silly.

      --
      Bad Panda! No Bamboo for you! In matters of importance ACs will not be responded to. Want to say something critical,OK
    5. Re:PHP's broken security model by Mr.+Darl+McBride · · Score: 2, Insightful
      You gotta be kidding, right? I mean this isn't even a concern if you aren't running in a shared hosting environment. Seems a bit premature to toss out an entire programming language that could potentially be beneficial because you don't agree with how it's implemented in one particular situation.
      I would venture to guess, and I doubt I'd be far off, that this "one particular situation" represents >90% of all potential php servers. It is absolutely insane to ignore this.
    6. Re:PHP's broken security model by Mazzie · · Score: 2, Insightful

      Ahhh... the search for the "perfect" language continues.

      No one language is going to work for everyone. Is PHP the most secure language? Definitely not. Is it one of the easiest to learn languages? Yes.

      Hind-sight is 20/20. I am sure that way back when PHP was created, had they known that such a ginormous percentage of websites on the Internet would be using it they might have done things differently. Who knows...

      PHP is so popular because it is easy to learn, supported by a massive, massive user base, and is developed rapidly in response to user requests for new features. Is PHP an enterprise language? That is a hot topic of debate.

      Some people would argue that Perl is an enterprise language, and that started out as a tool for system admins to make managing *nix servers easier. PHP started out as a tool to make developing dynamic websites easier.

      It would be hard to argue against PHP being an extremely powerful language for developing websites. As site developers demand more and more from the language, and build bigger and bigger apps I think it will grow and morph to meet those challenges.

      I don't think PHP is going anywhere anytime soon, and I think its only going to improve as more people jump in and help improve it.

      --
      Having a bookmark to Google does not make you an expert on everything.
  2. code in the db, wow! by Charles+Dart · · Score: 2, Funny

    The idea of being able to manipulate store retrieve and execute on the fly is currently blowing my mind. I can't wait to get started on it. This is truly groundbreaking


    Bring on the Lang X has had that for years

    Yea, with a lot of lame hacks you could have done this with a file structure with php itself. But this sounds seamless.

  3. Php in the enterprise? Scary thought. by neiras · · Score: 4, Insightful

    Since its inception, PHP has gone from a simple website templating language and form processing tool, to a semi-OO scripting language hacked onto a bunch of C extensions, and now they expect to become a fully OO, enterprise-ready language?

    Scary.

    To write web applications properly and efficiently, you need a framework to support you. You do NOT want to be reinventing the wheel. Have you noticed the massive proliferation of database abstraction layers, incompatible form processing libraries, etc. etc. all written in PHP for PHP developers? Libraries of code written in a templating language! Eep. Every reasonably experienced PHP developer has probably tried to create an application framework at some point - if people keep seeing the need for one, it's a good bet PHP needs to supply one. No, PEAR is not an application development framework.

    And what is it with all those PHP developers who seem to think a "class" is another term for "static function library"? The concept of using object types is foreign to thse people - they'd rather make huge monster arrays.

    Just because the "I Can Use A Database So I Must Be A Web Developer" crowd thinks every web app could and should be written in PHP does NOT mean that that's actually the case.

    PHP downright _encourages_ beginners to embed application-logic in HTML pages. I've been through a rewrite of an absolutely MASSIVE PHP site, and it was a year-long affair for five developers. The old site had become impossible to maintain. Talk about a waste of resources.

    When PHP adopts a *standard* way of separating content logic from application logic, and enforces that split (kind of the way JSP pages work with servlets), then _maybe_ there will be some hope for it in the enterprise. Until then, Java will continue to dominate. I find it funny that Java interaction is such a high priority for PHP - if Java's installed on a company's hardware, a developer's natural reaction would be to use Java, not write something in some other language.

    1. Re:Php in the enterprise? Scary thought. by wan-fu · · Score: 4, Interesting

      I do agree that all too often applications are rammed into PHP without too much forethought; however, I think PHP is already going in the right direction for enterprise level development. The object orientedness of the language is much improved since PHP3. They have the Smarty template engine which does a fairly good job of separating presentation from application. People should be encouraged to use it and I think as PHP apps get bigger, people will begin to realize the advantage to separating design logic from application logic. Most importantly, there are a variety of third-party developers creating frameworks such as the Horde framework or Blueshoes framework (I no affiliation with either). And that's great that there are such frameworks. It's not the job of the language developer to create the framework imho (e.g. CPAN does a great job supplementing Perl)

    2. Re:Php in the enterprise? Scary thought. by ceejayoz · · Score: 2, Insightful

      It entertains me that many of the arguments against PHP in the enterprise can be summed up as "well, it's possible to do it poorly."

    3. Re:Php in the enterprise? Scary thought. by JimDabell · · Score: 3, Informative

      Since its inception, PHP has gone from a simple website templating language and form processing tool, to a semi-OO scripting language hacked onto a bunch of C extensions, and now they expect to become a fully OO, enterprise-ready language?

      Scary.

      Scary? Projects evolve. Apache wasn't always "enterprise ready". FreeBSD wasn't always "enterprise ready". Just because something started out as a pet project rather than at a lab, that doesn't mean it's automatically "tainted" and cannot ever be useful to big businesses.

      Libraries of code written in a templating language!

      PHP may have started out as a templating language, but it is a general purpose scripting language now. You can even write GUI applications with it.

      And what is it with all those PHP developers who seem to think a "class" is another term for "static function library"? The concept of using object types is foreign to thse people - they'd rather make huge monster arrays.

      So the language is judged on its worst practitioners? If that is the case, then, judging all languages equally, we'd better just give up this programming lark and hide under a rock.

      Rewrites of crufty code are not exclusive to PHP, you know. Neither are bad developers.

    4. Re:Php in the enterprise? Scary thought. by natmsincome.com · · Score: 2, Interesting

      Your arguments are great but they apply for almost every lanugage I know of.

      As for frameworks look at apache. Have you seen how many frameworks it has for java? What about Swing, AWT, SWT etc? Just because they're are lots of frame works doesn't mean it bad.

      I agree with your class as a static function library but that's not PHP's fault. C++, Java and Perl have the same problem. When people learn C or VB first and then go to an OO langauge they generally get it wrong.

      As for bad projects I sure if you did an "Ask Slashdot" they'd be able to tell you about bad projects C, C++, Lisp, PHP, Java, J2EE, .NET, etc.

      As for a standard was of seperating logic from content lots of people say that JSP isn't enough that's why you have stuff like Velocity and all the other framework template engines. If you want a template engine for php the default one is Smarty.

      When it come down to it the problem you have with PHP is that it has a lot of newbie programers that use it. Which is good and bad. Try making a simple form in JSP then do the same thing in PHP. PHP is ALOT easier. That doesn't mean it's better but it does mean people with a lower skill can do it. I'm using templates for our internal site and when other people edit it half the time the escape and got back to raw PHP and it's a mess so I fix it up and it's all clean again but they just don't get it untill after I show them then it make sense and they can do it but the next time they can't figure it out so it happens again etc.

      Does it mean you get lots of bad half baked libraries YES does it mean you get good libraries and frameworks YES (because more poeple start, so more people get good at it).

      If you want to look at good php projects check out:
      * Smarty
      * Mambo
      * Gallery
      * phpBB
      * JpGraph
      * phpMyAdmin

      That being said at what level do you move someone from a "HTML + PHP Hack" to a "Web Developer"?

      What makes a lanuage "enterprise-ready"? Does an "enterprise" company just have to use it (IE Yahoo and PHP). Or does it have to have faetures?

      Where I work we still use PROC and PIC which is a 40 year old language that doesn't have:
      * Variable Names - Only numbers!
      * Functions - Only GOTO and GO SUB (again numbers no names)
      * All variables are global!
      * No loops!
      * No else - You have to use IF and GOTO!

      Yet this is still being used in thousands of companies all over the world! Sure it's legacy but it's enterprise ready and still being used!

      So could it be used on a massive site handling 1,000 of concurrent users? Yes, IF IT WAS DESIGNED IN THE RIGHT WAY. It wouldn't be the same design as you'd use for .NET or the same as you'd use for J2EE but it would work. It might not be the best but that depends on the problem. (Same as Clusters vs Grid)

      I've ranted engough ... have fun pulling my comments to peices.

  4. Smarty is a joke. by neiras · · Score: 3, Insightful
    I'll say it again: Why would you write a templating language in PHP? Smarty fills a need that does not exist. The separation that needs to be there is between PHP code that affects layout, and PHP code that does stuff like writing to databases, processing forms, etc.

    You don't need a "templating engine" to gain that separation. You need a standard, well understood way of organizing your PHP application, and some libraries of code to support that method of organization - that is, you need an application framework. And PHP sorely needs a *standard* one. It may not be the language developers's job to create it, but it would certainly boost PHP's image if they did - imagine the flood of nice, interoperable applications that would emerge!

    CPAN is not a framework, it's a massive library of code libraries, same as PEAR on the PHP side. Code libraries are good, but they don't define a way of structuring your application.

    Perhaps one of those frameworks you mention will become a standard, but as long as they implement 'templating languages' I'm not going to hold my breath. PHP may be going in the right direction with the new stuff in Zend 2, but it's still way off the mark for serious webapp development.

  5. Re:Bunch of Perl haters by sumbry · · Score: 2, Interesting

    I mean, let's get serious, Perl allows GUI apps with Tk, writing your own custom servers, parsing local files via command prompt and what not

    PHP GTK - http://gtk.php.net/
    Sockets for PHP - http://php.net/manual/sv/ref.sockets.php
    PHP Process Control Functions (fork, etc) - http://php.net/manual/en/ref.pcntl.php
    PHP Functions to Parse Conf/Ini Files - http://php.net/manual/en/function.parse-ini-file.p hp

    PHP also builds a CLI (command line interface) everytime you compile it enabling you to do perl style #/usr/bin/php and writing command line scripts (even full argc/argv support).

    I'm a PHP developer - I do not think "Perl sucks" but I do think developing web applications on PHP is quicker and easier (for me) than in Perl, especially since I'm a native C coder.

    To each is own.

  6. I write web apps efficiently... by Phil+John · · Score: 2, Interesting

    ...using n-tiered when it suits the domain (just finished a rather tasty J2EE system for a large client). Even a fairly complicated e-commerce engine can be done quickly and efficiently in PHP though if it's being done by someone who has years of "real programming" experience, not someone who comes along and hacks together a personal webpage or pet project (which invariably requies register_globals to be on, yuck).

    There is a framework out there that is proven, reliable and very easy to start using, it's called Fusebox.

    It has increased our productivity, encouraged code-reuse (instead of write-once never touch again hacks) and meant we get every single project out of the door on time and under budget.

    And now with Smarty being taken under PHP's wing so to speak (http://smarty.php.net) you can truly separate display from business logic in a nice simple way.

    But once again it comes down to this: Use the right tool for the job! I would never think of using PHP to power an online banking system, but then again I wouldn't use a 3-tiered enterprise system to run a bulletin board.

    --
    I am NaN