Home | All Questions | alt.html FAQ >

How does PHP compare to ASP?

Microsoft's Active Server Pages (ASP) comes with VBScript and JScript scripting languages, but you can also install scripting engines for Perl, REXX, and Python, whereas PHP will only ever be PHP. The most commonly used flavour of ASP is that written in VBScript. VBScript is a subset of Visual Basic, a standalone compiled language. This very fact makes ASP marketable to VB programmers wishing to build applications for the Internet. However, as a script language VBScript could never compete with its big brother, Visual Basic, only supplement it. In making this point, VBScript is not solely a glue to hold Visual Basic together with an Internet front-end, but that's really what it does best.

ASP can prove to be very memory hungry beasts and regular calls on system objects, such as Active Data Objects (ADO) for working with databases can make for slow applications on heavily loaded machines. VBScript lacks many important features, which can be added through Component Object Model (COM) objects. An example of this, is when trying to send e-mail using VBScript, although the objects are available, they can be costly and more time consuming than the PHP equivalent (mail function). PHP can also be 'added to' with additional functionality being quite platform dependant. COM functions are supported by the Windows version of PHP and many libraries are available for *nix versions.

VBScript interpreters are available for various Unix based systems and Windows. However, finding a COM object that will send e-mail on a Unix system is nearly impossible and very expensive. This leads to the conclusion that ASP is only really at home in a Microsoft environment. It has its fair share of security flaws, but when used by professional VB programmers, I have seen ASP provide some immensely powerful interfaces. PHP on the other hand can be seen to provide the best results in the form of stability and speed on Unix based systems.

PHP is Open Source software, which is great as it means that code, manual, updates and support are all free. Although the ASP script engine comes included with IIS and PWS and minimal support is available free, running Microsoft operating systems at a commercial level is always going to be costly.

A lack of high profile sites using PHP makes it a bit harder to prove it's robustness and gain acceptance from non-programming colleagues (e.g. management), but for a programmer the portability and stability of PHP is beneficial.


Can anybody give me a relevent argument, advantages or valid points that I can argue for PHP.

IIS and Windows have a long history of security bugs (apache/unix does too, but are far less easily exploited), remember Code Red or Nimda?

Windows is not particually renound for stability. Many admins have torn their hair out after the server farm has died for the upteenth time.

Once you start developing MS software, you are then locked into their software. It runs on MS platforms only. Take a look at the rising costs of purchasing MS licences, dig back to DOS 5/6 days for a price and compare that to todays prices.

There is also the threat from MS that you will have to pay annual licences for future updates (wether you want them or if it's MS's faulty code being fixed).

PHP is cross platform capable, it'll run on high end UNIX servers to low end windows boxes.

It's open source, the code can (and is) easily be audited to reduce the risk of security bugs.

It can easily be interfaced to different databases as needed, SQL Server, MySQL, Postgres SQL, Informatix and Oracle are all supported natively, and with full ODBC or ADO support available too.

PHP is not based around a large number of different object classes, and therefore is easier to learn and develop pages with.

Recommended Resources

Discussion

Related Questions