williams at morinda
Feb 15, 2000, 12:17 PM
Post #1 of 2
On Sun, 13 Feb 2000, Jason C. Leach wrote:
> I'm looking for some info on the pros and cons of PHP and mod_perl. Can
> anyone direct me to some.
> I'm mostly concerned with what is faster or all around better to program in,
> especially for something like an eComerce site and of coarse doing DB work.
Disclaimer: My bias is toward mod_perl, and I have not yet used PHP4.
If you are doing DB work, perl's DBI is a big plus in mod_perl's favor.
PHP uses a different API for each database, but DBI gives you a single
API for each database. If you are not using database-specific SQL, you
can change one line of code and switch to a different database.
Personally, I am using Oracle as my database and DBI has good support for
Oracle's advanced features, such as PL/SQL and BLOBs. PHP on the other
hand, has especially poor support for Oracle, compared to other databases
My other impressions of the two:
With mod_perl, you get all the power of perl. PHP's language and modules
are certainly adequate, but not as powerful. If you are an extreme
programmer, you would probably prefer perl, but if you are a part-time
programmer, PHP may be easier to learn.
PHP's main feature is embedding code in HTML. If you want that with
mod_perl, "there is more than one way to do it". (ie ASP, Mason, Embperl,
ePerl, etc) Again, PHP may be easier to learn in this case, but the perl
methods have a lot of advanced features.
~ John Williams