in reply to PHP over perl

Why PHP is preferred over Perl nowadays for web development?.

Is it because PHP is easy to learn compared to Perl?.

No. It is, mainly, because PHP is easy to deploy, faster than CGI (instant gratification), and safer than mod_perl.

But there is hope for Perl, to maybe beat PHP on its own territory: see the article CGI is Dead; mod_perlite is Alive! on perl.com.

Replies are listed 'Best First'.
Re^2: PHP over perl
by perrin (Chancellor) on Feb 10, 2009 at 13:34 UTC
    PHP is only safer than mod_perl if you run it through CGI or certain configurations of FastCGI, which of course you could do with Perl too.
      From a security perspective, sure, but it's my understanding that one user won't accidentally affect another with PHP, whereas it's trivial in mod_perl (e.g. two users with similarly named modules, a normally innocent change in one of many global variables, etc). Please correct me if this is incorrect.

        The big difference there is that mod_php is able to restart the PHP interpreter for each request. (You can do something similar with mod_perl, as I've pointed in the past, but no ISP is going to bother.) And from a security perspective, mod_php runs as the web server user, just like mod_perl does.

        Frankly, I'm not sure why people are still talking about this, when so many cheap ISPs support FastCGI. You can run PHP or Perl on FastCGI without any security concerns beyond those of CGI. If you run a dedicated server, you can use mod_php or mod_perl for more features. Seems like a done deal to me.

Re^2: PHP over perl
by tilly (Archbishop) on Feb 10, 2009 at 18:55 UTC
    I read the article, looked at their approach, and concluded that it was almost useless. If, for instance, you have a database backed site, the prime cost of CGI is in initializing code and connecting to the database. The approach that mod_perlite takes does nothing to help with those costs.