Digital Projects Consultant PMI-ACP | PMP®️ | MBA | ITIL
PHP vs ASP.net Comparison
PHP vs ASP.net Comparison
A comparison of PHP (Open Source) vs ASP.net (Commercial), Performance, Cost, Scalability, Support and Complexity
I. Scalability and Ease of Maintenance
Scalability and ease of maintenance have nothing to do with whether you select PHP or ASP.net platform. Web Application scalability and ease of maintenance primarily depend on:
- Programmers’ experience
- Using the best programming practices
- Using a solid programming framework
- Following programming guidelines and standards
II. Performance and Speed
MySQL is used by Google, Facebook, YouTube, Yahoo and recently on FIFA World Cup which received a huge audience around the World. So I would not question the capability of the MySQL database server.
Based on my research on a few online stats, as of this writing, the communication and interfacing between PHP and MySQL is faster than ASP.net and MSSQL but it is not very noticeable.
Based on my research on a few online stats, as of this writing, the Linux OS and ext4 (file system) performs better (IO) than Windows OS and NTFS (file system.)
Most Linux / Unix servers are run very lean without any extra un-needed packages or GUI interfaces and therefore the OS uses a lot less CPU and RAM which provides more allocation to the database and web server.
Most windows servers run clunky and with many un-needed packages and GUI which will be using much more CPU and RAM.
Obviously, a LAMP platform will have an advantage over the ASP.net platform because it will have more available resources.
Additional items that can have an effect on performance but have nothing to do with which programming language is selected are:
- Ability and knowledge of programmer(s) to optimize the code
- Ability and knowledge of programmer(s) to write proper and optimized SQL queries.
- Functionality required (some functions may take longer to execute in the ASP.net platform and less time in PHP platform and vice versa.
PHP, MySQL server, PostgreSQL server, Apache server, and Linux OS are all free and upgrades are also free. In addition, there is no additional licensing cost for having another hot standby server as a backup, or needing to run multiple servers for load balancing or server clustering.
LAMP (Linux, Apache, MySQL and PHP) is also much more popular among hosting companies, and its popularity results in a lower monthly hosting cost for LAMP hosting compared to Windows hosting.
ASP.net and IIS are free if you purchase Windows OS. There is a substantial licensing cost for a Microsoft Windows Server, Microsoft SQL Server and future upgrades. For example, Microsoft Server 2008 R2 Standard – 64-bit cost is about $1029 and Microsoft SQL Server 2008 Standard Edition For Small Business cost approximately $1038.
The above licensing costs for Microsoft can substantially increase if the site becomes popular and
IV. Support and Resources
Since LAMP is open source, there is a vast amount of dedicated and friendly developers around the world who continuously make improvements and updates, and provide support for the platform. Additionally, there are more support resources and developers available for PHP and LAMP Platforms.
The reason why I mentioned the word “friendly,” is because Open Source developers who contribute to the Open Source community are doing so not for financial gain. If you seek help with a functionality challenge and post a question on a PHP forum, you will receive useful information from friendly contributors.
ASP.net relies on an available number of developers at Microsoft for making improvements and updates. There are less support contributors available to solve ASP.net challenges.
V. Time to Deploy
It takes a larger amount (more lines) of code to accomplish complex features and functionality with ASP.net compared to PHP, adding more time to the development process.
Additionally, PHP is interpreted at the server, so when changing a functionality, no additional steps are required to see the changes. On the other hand, ASP.net needs to be compiled each time the code is modified. Again, the development process is more time-consuming when using ASP.net as opposed to PHP.
VI. Editors and Tools
PHP & MySQL is editor independent. PHP developers have access to an extensive number of editors.
Most ASP.net programmers rely on Microsoft Visual Studio editor to help them develop .NET Applications. (Many ASP.net developers love and swear by the Microsoft Visual Studio.)
It is a different style of programming — PHP and open source developers tend to use text editors such as VI, VIM, Notepad ++.
VI. Platform Independent
PHP is platform independent and can run on any platform — Linux, Unix, Mac OS X, Windows.
ASP.net is built to run only on Windows platform.
VI. Which popular sites run on which platforms?
|Site||Up Since||Server Platform||Programming
|Google.com||November 1998||Linux||C, Java, C++, PHP & MySQL|
|Facebook.com||February 2004||Linux||PHP, MySQL and C++|
|YouTube.com||February 2005||Linux||C, Java and MySQL|
|Linux||C++, C, Java, PHP & MySQL|
|MSN.com (owned by Microsoft)||August
|Live.com (owned by Microsoft)||August
|Linux||PHP & MySQL|
|Linux & Solaris||C++, Java, J2EE|
|Linux||PHP & MySQL|
The LAMP platform is much more popular than the Windows platform.
Based on Netcraft’s July 2010 Web Server Survey of 205,714,253 sites, 112,945,968 (54.90%) are hosted on Apache and 53,217,620 (25.87%) are hosted on Windows; the rest are hosted on other platforms.
VII. Usability and Ease of Deployment
There are many misconceptions and misinformation about Linux being unfriendly.
This really depends on the experience and knowledge of the person setting up the platform.
Unfortunately, in my opinion, Microsoft Server has been going backward with usability, by making the server administration extremely clunky and filled with complex and un-needed features.
Research for this article was completed August 1, 2010; pricing and other information may change.