The debate of comparing PHP to ASP needs to be understood from the ancient times of the internet evolution.

HTML, the fundamental building block of the internet, remains largely unchanged since the first browsers.

Back end programming, however, has been experiencing growing pains since CGI was introduced. Traditionally, web pages were given added functionality via CGI, programs typically written using traditional programming languages such as C or Pascal, or Unix shell scripts. One of them was Perl, which was quite famous among the web-developers.

Perl remained the mainstream solution to web backend programming for several years until 1996, when Microsoft introduced a product known as Denali, which used the VBScript language in an attempt to attract web developers yearning for a simpler alternative to Perl and C. In late 1996, Microsoft renamed Denali as ASP 3.0 and released it to the public bundled into IIS at no charge.

The concept caught on, and ASP quickly grew to become one of the most popular web development languages, partly due to the Microsoft marketing machine, and also due to the timely release of a much desired concept; inline code, coupled with a simpler language, provided the right conditions for a multitude of up-and-coming web developers to jump on the bandwagon.

1996 proved a pivotal year for back-end web development as a new web language called PHP was gaining popularity. PHP is a recursive acronym for PHP Hypertext Processor, originally started in 1994 by Rasmus Lerdorf as a Perl wrapper to simplfy his back-end programming. By the end of 1996, PHP was in use by 15,000 pages. In 1997 PHP3 - the first widely-used version of PHP - was released, growing explosively to being used on over one million sites by the time PHP 4 was released in April, 2000. PHP’s rapid growth signifies a marked change in the direction of web development, a paradigm shift from awkward and time-consuming back ends of Perl through kludgy ASP and now to streamlined PHP.

PHP draws it’s strengths from C and from Perl; the language is simple and easy to understand. PHP’s simple structure allows beginners to easily pick up the language while advanced tasks, such as file uploads, graphics manipulation and database connectivity are easily within reach of the beginner. PHP’s vast power and unsurpassed functionality is derived from the huge storehouse of built-in extensions that are bundled with each PHP installation, offering far more functionality than could ever be desired by the most wanting developer.

Advantages – Disadvantages

PHP: PHP is an object oriented language + Scripting language
ASP: Scripting only language

PHP: Cross Platform + Open Source + Support for Major Oss + Functions with Major Web Servers
ASP: Windows Based + Expensive + No support for other OSs + Functions with only IIS

PHP: Easily extendable with many extensions (eg. Simple capabilities, such as FTP, data compression, file uploads, XML, MD5, encryption and email)
ASP: One has to pay for 3rd party extensions.

PHP: Complex functions such as dynamic images, IMAP, SNMP, dynamic flash, PDF, native access (non ODBC) to Oracle, Ovrimos, Postgre, Sybase, mSql, MSSQL, Ingres, Interbase and Informix databases, LDAP, and sockets, just to name a few, are available for free to any installation of PHP
ASP: These functions are not available with ASP (and probably never will be) available with ASP.

PHP: PHP is a more mature language than ASP. PHP has been around since 1994
ASP: ASP has only been around since 1996

PHP: PHP has a huge base of developers working on it every waking minute of every day; bugs are usually fixed within minutes of being reported and new features are being integrated daily.
ASP: Bugs take eternity to get fixed or probably unless you are a big company, your bug report is considered lost in space.

PHP: Primarily, PHP runs on notoriously fast Unix and Linux servers which have for years outpaced Windows running on comparable hardware.
ASP: ASP is significantly slower than PHP, for obvious reasons. ASP does not run on any operating system other than Windows, and even then, only in IIS and PWS. I could discuss countless reasons why IIS makes a terrible web server.

PHP: MySQL is a database that PHP closely integrates with; it is a very powerful database that rivals Oracle in speed. Like PHP, MySQL is FREE, and blows most other databases out of the water.
ASP: ASP natively supports mostly Access and MSSQL easily. Microsoft expects you to develop using Access and when your webpage outgrows it, to switch to MSSQL, an extremely expensive option. What most people don’t realize is how quickly you can outgrow Access. Although you’re technically limited to around 30 simultaneous connections, realistically it’s closer to 5. Not many websites can survive such limitations. Most moderately sized websites require over 1000 simultaneous database connections. In addition, Access is SLOW. And you forego a lot of cool database functionality such as stability, transactions, replication, stored procedures, triggers, and so on. There are so many reasons not to use Access, I can’t even begin to elaborate on them here.

PHP: While even the best software has glitches, PHP has surprisingly few. The PHP development team has an outstanding reputation for fixing bugs, and in order to streamline the process they even have an online system through which new bug reports can be submitted. Most bugs are resolved within 24 hours
ASP: There are a huge number of outstanding bugs in ASP which will probably never be fixed. Unless you’re a major corporation, chances are that your bug report to Microsoft will likely go unanswered.

And finally, PHP is free; ASP isn’t. The cost of running an ASP-based website implies a full Windows server platform; development costs are higher, software licenses are expensive and, speed, security and flexibility are all sacrificed.

There’s a reason that UNIX and Linux are dominant in the server market; cost-effective, security and performance leaves nothing for a debate.