PHP vs ASP

By: John Lunney (johnl) Posted: 16-Jun-02, 06:46:54 Rated: General

Alert!: Attention: Cet article/tutorial est ‰gé de plus de 45 jours. Ainsi les informations qu’il contient peuvent être, maintenant, dépassé. Merci de lire toutes les informations qu’il contient pour vous assurez que cet article fonctionnera bien sur votre système

This is my first article, so bear with me.
This will (hopefully) be the first in a series of articles comparing PHP to some of the other languages available.
Here we goÉ

PHP vs ASP

ASP is not really a language in itself, it’s an acronym for Active Server Pages, the actual language used to programme ASP is Visual Basic Script or JScript. But anyway, on with the comparison.

Speed
PHP is faster and more stable than ASP. ASP is built on a COM-based architecture so when ever a programme tries to connect to a database or file he calls a COM object. When that COM object tries to access the file system it calls up yet another COM object. All these COM overheads add up and slows things down.

In PHP modules, everything runs in PHP’s memory space. This means that PHP code will run faster because there is no overhead of communicating with different COM objects in different processes. In this case too, ASP is slower and more memory intensive than PHP’s model because each ASP language compiler runs in its own process.

Price
PHP installations are far cheaper to install than ASP installations. PHP runs great on Linux which is free, on the other hand ASP runs on the IIS Server (Internet Information Server) which need’s Windows N.T/2000/XP, any of which costs a lot, especially when compared to the price of PHP, nothing.

Apart from that ASP mostly uses MS-SQL Server as the back end which again is expensive, Where as PHP programmes mostly use MySQL which is FREE!

Extras
With ASP, if you need to upload files, then you need a third party component ASPuplod, if you want to send mail or encrypt passwords you need another component and so on. Each of these components has to be bought.

In PHP, if you want to FTP, encrypt passwords in MD5, or send email from a web page, you do not need any extra components as they are all built-in, which is, incidentally, another speed increase. Because everything is built-in, there is no extra layer of COM objects and access to email, for example, is faster than in ASP. Since PHP is Open-Source there are lots of plug-ins and lots of sample code.

Platform Support
PHP runs on Mac OS X, Windows, Win NT, Linux, Solaris, Unix, BSD etc.
ASP runs on Windows, under MicrosoftÕs IIS server, but there are a couple of projects that allow ASP to run on other platforms and servers but guess what, most of them cost money.

Summary:

Speed:
PHP: Faster.
ASP: Limited by COM-object model.
Cost:
PHP: Free.
ASP: Money.
Extras:
PHP: Many, free.
ASP: Limited, cost money.
Platforms:
PHP: OS X, Win NT, Windows, Linux, BSD, Solaris, Unix etc.
ASP: Windows, with commercial adaptations for other platforms.

Updated 23/06/02:
After the very kind comments on my article I have decided to add and discuss some of the points they raised.

Why does ASP still dominate?

Firstly, ASP does not dominate. The truth is quite on the contrary.
ÒZend Technologies Ltd., the designers of PHP 4 and the Zend Engine, today announced that as of April 2002, PHP, the open-source software phenomenon, has surpassed MicrosoftÕs ASP as the most popular server-side Web scripting technology on the Internet.Ó
There is, in fact, only a perception that ASP dominates industry. Just remember who makes ASP. ThatÕs right, Microsoft. Many people in the industry were brought up using Visual Basic and it is natural that they should continue using it. These people would mainly be in industry or big business. Now, this is just an opinion, but it seems to me that big business web-sites often seem to use ASP where as community web-sites often use PHP. Could there be something in that?

-John Lunney

Leave a Reply

Your email address will not be published. Required fields are marked *