[Ilugc] apache and php
- From: lug@xxxxxxxxxxxxxxxxxx (Chandrashekar Babu)
- Date: Sun Aug 21 12:53:50 2005
On Sun, 21 Aug 2005 11:54:06 +0530, peevee <peevee.chaitanya@xxxxxxxxx>
wrote:
I dont understand one thing,
why are people still after PHPwhen JSP and other things have come up?
* PHP is more easier to setup and work with
than JSP. It has minimal dependencies and
integrates well on most widely used
webservers.
* I dont get to see websites /randomly/
coughing up an "Internal Server Error"
page with a java exception list
on PHP websites. I dont know whether to
blame the programmer or JSP itself, I still
find most JSP based websites buggy and
unstable.
* PHP is more suitable for simple to medium
sized websites/portals due to its simplicity.
* It is easier for a perl/shell-script programmer
to migrate to PHP than JSP.
* It is a lot easier to process/manipulate text
data on PHP than on JSP, which is a critical
deciding factor for developing on the web. This
also applies to manipulating strings,
arrays/lists, hashes, files and databases.
* In most cases, what would take several thousand
lines of code to develop using JSP can be done
using PHP is a couple of 100 lines (or even less).
[I state this from my personal experience of
migrating a buggy community portal originally
written by someone else in JSP onto PHP].
* PHP is tailored from the beginning to cater
to web development, while JSP is merely a plug
on Java to make it viable for the web.
Of course, JSP/Servlets are best used to develop
maintainable large-scale/complex web applications.
Infact, thats the only place where Java shines.
It somewhat enforces programmer/design discipline
which is good for large-scale development and
maintenance (much like COBOL), but can be annoying
for hobbyist programmers and those that work on
smaller projects.
PHP is scripting, so it should be more resourcehungry on server, rather
than jsp etc.
Resource hungry than JSP ? Well well.. you haven't
hosted a JSP based website on a commodity-class
hardware, have you ? If you did, you'll know how
much of a bloat JSP really is when compared to
PHP or mod_perl.
As a simple test, try running Apache with Tomcat
(or any JSP engine of your choice) and check the
memory usage of your server on about 100 connections.
Now, do the same on with Apache and PHP and now
compare.
Try the same with CPU utilization by automating
multiple page requests on your server and compare
JSP vs. PHP and you'll be surprised :-)
The claims that scripting languages are
resource-hungry and slower than so-called compiled languages are plain FUD
and make no practical sense
these days.
If I had to worry too much about resource usage of
my website, I'd rather switch to writing my webapps
using C and FastCGI enabled on Apache than using JSP.
--
Chandrashekar Babu.
http://www.chandrashekar.info/
Other related posts: