Hawkfield: web development & web design

Your partner in IT - Gent Belgium

Why choose PHP or ASP over the other


The eternal battle, why would I should choose and use PHP and not ASP, or vice versa. I use them both, and I will try to list any advantages from one over the other.
The choice becomes even harder when including ASP.NET, but that discussion is for another article.

The first thing you need to decide is where you will host your websites. If the answer is linux, the choice of ASP is no longer available for you. ASP for linux exists in several forms from several other companies, but all of them lack some features of the real ASP, and most are not very stable.
When hosting on linux servers, PHP is a very good choice. There are others though, like JSP or PERL, but I advise anyone to opt for PHP when developing sites.

If your operating system is Windows, you still have the choice. Both ASP and PHP are supported on windows.
The advantage of PHP is that everything (or really alot) is supported by the language. For example uploading files is readily available when having PHP installed. This is not the case with ASP, you will need to purchase third party components to handle them, or write them yourself.

Another valid point in favor of PHP is that it's free software. ASP is delivered with your Windows Server software, so when you do host on windows anyways, the price of PHP (or the lack of) is not really an advantage.

Performance issues are also important when running websites on your server.
Having PHP query a MySQL database is generally faster than having ASP query an MsSQL database via ODBC.
I choose MySQL en MsSQL here because those database have a really good integration with the different languages respectivly. We do have to note, while MsSQL will cost alot more than MySQL (which is free), that MsSQL has alot more features. However this is not really an issue to choose ASP over PHP (you can as well use PHP with a MsSQL database).

Then there is the language itself. PHP is a C/C++ style language, which might be hard to learn for people not used to it. ASP can be written in either VBScript, which resembles Visual Basic and is quite easy, or JScript, which resembles the syntax of JAVA.
The choice here is very personal.

In the end, I'd have to advise you to stick with PHP if you use a linux server, and ASP when using a windows server. If you have not yet made the coice of an operating system, be advised that linux is hard to maintain, but more stable and secure. Windows is easy to maintain, but hasn't got the same performance or stability linux has.