PHP vs ASP(Dot)NET, Which one wins?

Hello friends, if you are reading this topic then you should be some how relating to PHP. Ok so question here is, I have heard that PHP is faster than ASP dot NET, it is more secure, it is free. But still PHP hosting is cheaper than Windows hosting. There is a general concept that the expensive things usually have advantages so my question is:
Does PHP lacks any thing as compared to ASP dot NET?
or Does ASP dot NET have more power or any extra features than PHP?
This looks like a simple question but when discussion will start, we should have great comparative information for PHP and ASP dot NET
Waiting for your replies:)
This should be a long thread

“PHP is faster than ASP dot NET, it is more secure”
You have to be kidding about that right? PHP faster then compiled code? Security is depended on the developer.

It depends, are we talking about a cage fight or mud wrestling?

For starters, raw performance is irrelevant. You can reach the same throughput with similar budgets on both platforms. Coder ability influences performance much more than platform choice.

ASP.NET beats pure PHP in CRUD development speed, although there are several PHP frameworks that remedy this situation.

PHP offers finer control on the HTML output. Regular ASP.Net still uses table-based layouts and other hacks, although my understanding is that there are ways around this limitation, specially if you use the Rails-inspired MVC framework.

PHP’s API is notoriously bad, with hundreds of functions in the main namespace. The .Net API is very good, building upon the examples and counter-examples of the Java API.

Most new programmers with a web design background find it easy to start using PHP. Most CS students prefer .Net because they’d rather not have to write HTML.

… or something third, more likely.

ha ha ha (with a pause)
remember my words it will end as
hen came first or the egg?

^^^ A properly managed server should not crash regardless of the platform. If it does, something is awfully wrong with the admin. Speaking of which, if you are just learning how to manage a server, do NOT under any circumstance should you practice on a LIVE production server.

Windows Server 2008 + IIS7 + FastCGI (PHP VC9) === Solid
In this configuration when and if PHP crashes only that instance running is affected. The web server stays up and continues to spawn new instances of PHP or whatever. PHP VC9 is tailored for running on Windows and IIS, however it is only available for PHP 5.3 Alpha at the moment.

I can say the same for Linux/Unix, running PHP as FastCGI under Apache or even the module. It all depends on the system administrator managing the servers.

Actually, this is what is the best in PHP :wink:

I would not know, I do not know of anyone thats done any extensive benchmark testing on any of the latest (i.e., IIS 7, Apache 2.2) offerings out there. While I’m sure, historically PHP performed better on non-Windows platforms because it was tuned to Linux/Unix systems. However, sense the partnership between Zend and Microsoft that line is becoming blurred.

If you are concerned about security, IIS has been solid since version 6. Microsoft learned their lesson the hard way back with IIS 4 and 5.

Apache 2.2: 15 Vulnerabilities, 2 Partial Fix, 2 Not Patched.
IIS 6: 4 Vulnerabilities, All Patched
IIS 7: 1 Vulnerabilities, All Patched

Vulnerability Report: Apache 2.2.x
Vulnerability Report: Microsoft Internet Information Services (IIS) 6
Vulnerability Report: Microsoft Internet Information Services (IIS) 7.x

ok dear member with the 5 post …i have been in this forum for 5 years now and i know more about this forum than u…
i can show u around 30+ tropic on this very debate in this forum(in around 10 i have also written eassy for php)…
so this has been a regular tropic that pops up every month…but search for it and show me if there were any conclusion…

or i would say now…it cannot be compared in that way

and most imp use search…even this forum before u post any thing…

egg was definitely first nothing to discuss.

Windows is most insecure OS is UNIVERSE

That’s why lots of php sites are hacked/defaced . Because they’re running on Windows, right?

The security of a system depends on the admin’s skill. End.

The security of an application depends on the coder skill.

While php and are both valid, I prefer Contrary to some beliefs is NOT limited of spewing table based html or invalid html (not that this matters in 90% of the situations) . The webcontrols bundled within the Webform engine which is a part of otuput this kind of html, but they are just ONE OPTION. You don’t have to use them, you can make you own and you can use without taking advantage of the webforms features.

Yes, you can code just like in php, writing the html yourself.

I haven’t mentioned mvc yet, which is another option (still beta though) for you to use to have both the benefits of .Net without the disadvantages of Webforms. is VERY versatile. You can have maximum control over any output (from html to headers - without getting the 'headers already sent message ;)) and you have quite a few methods of processing the requests.

You want RAD? Just use some predefined controls. You want to be the master fo html? Go ahead. You want a filter applied for every request? Easy to ipmlement via modules. You don’t like webforms because they’re so heavy and you need just to process some data with little to no output? Use a handler.

Are you concernd about a heavy I/O operation that could block a thread? Just use asycnhronous handlers or pages.

As you can see there’re much more than predefined controls and web forms to . Yes, it’s a bit harder to learn and you have to invest some time and energy, but this is a powerful platform which needs to be mastered.

That’s why lots of php sites are hacked/defaced . Because they’re running on Windows, right?

First I wrote longer post saying that PHP is insecure also. but .NET itself looks for me secure as it clones Java. But then I decided to make it shorter.

I do not say about code written in PHP or .NET. Code it self could be secure or not.

Linux had vmsplice exploit that costed linux many points but Windows #1 non secure platform in the world. Kido is last example.

@max7, its amazing how you continue to post the same drivel over and over again. Security is depended on the System Administrator, and the Programmer. An incompetent System Administrator can make Linux full of holes and come crashing down. An incompetent Programmer can make a Java application insecure.

Security is not a single level defense, no single platform is secure on its own.

I agree with you. But I am not talking about “incompetent System Administrator”

I am saying that Windows, Microsoft and Monopoly are evil %)

And what does Microsoft being “evil” have to do with anything?

What evil has to do? Don’t ask me ! %)

I found these talks about microsoft and php very funny but you are very serious.

It is clear that there is a great demand for a better platform for development.
Once someone invents it then all talks will stop and people will start working.

I find it better to discuss ideal, best possible web framework and platform.

Coding should be simple but efficient.
Hosting should be cheap.
Solution must be scalable.

Major pretender is Google App Engine
Hosting is free
Solution is scalable

Coding is not simple. Just look on “counters” thread on google groups.

Oooh dear, another PHP vs .NET post.

My input is this: use the right tools for the job.

I use .NET because it does everything I want. I like static typing, I lihe the tools, I love C# as a language because of featurs like LINQ, lambda’s, anonymous methods. I like the direction it’s going to with C# introducing dynamica elements so I can use Ruby or Python or even PHP from my C# class.

Disregarding a language or platform because it is made by Microsoft or any other company is narrow-minded, extremely counter-productive and childish.

Your personal feels shouldn’t impact the choice of technology you decide to go with at work. You need to heavily factor in business concerns. Yeah, you might love PHP, but is it a viable platform to develop LOB applications for your employer? We deal alot with external data sources that come in a myraid of flavours. .NET allows use to interact with them fairly painlessly using using WCF, meaning we can concentrate on delivering software that adds value to the business. We also develop server and desktop solutions, and we can keep everything running on alot of the same services easily.

Different tools suit different projects, and if I was in a sitution where using a different language, I would jump at it as a learn experince. Sticking to one language will keep you narrow minded and unaware of other solutions and techniques available. I’m starting to learn Ruby, and already it’s got me thinking about how I developer C# a little differently and for me this can only be a good thing.

And just saying things like “Windows is most insecure OS is UNIVERSE” without solid proof in the context of the discussion adds no value to any discussion, and strikes me as something an ignorant 14 yr old fanboy would say.

I’ll have to disagree with that. It’s a strategic/political choice, and while it certainly has its costs, it can be a rational choice. I don’t really like the culture/environment that typically comes with the Microsoft technology stack, so I generally dismiss it up front. And I also find that it’s mostly a mutually exclusive choice.

That aside, I totally agree that the types of arguments, as well as the idea of comparing these two technologies, is pretty pointless.

I will agree that Microsoft’s .NET is super super super. It just proofs that it is designed by evil.

You take it too serious.

When you ask questions with a vague title, the argument becomes pointless. People will not read the post carefully and the discussion will move in all kinds of directions. What do you mean by “Which one wins?” Even in your post, you seem to be aware that there are significant differences between cost, application, etc. of each framework and “which fits your needs best?” is a better question that else.