Oh I had to answer this question for my management ever so recently and can give you a quick breakdown.

  1. Database Interfacing. PHP is made to interface with just about any database out there. ASP is picky and tends to only want to work with Microsoft stuff.

  2. COM calls. Every time ASP needs to do something, it uses a COM call and the more you do and more complex your program, the more COM calls. This can slow things down immensely. PHP doesn't even deal with COM but works equally well with IIS as it does with Apache.

  3. Cross platform compatibility. If you build a whole bunch of apps in ASP and then your system get hit by the latest worm and management decides to convert everything over to Linux, you're hosed. PHP on the other hand is cross-platform compatible. In other words, your scripts built on an ISS web server on Windows will still work equally well on an Apache web server running on a Linux box.

  4. Speed. PHP is by far leaps and bounds faster than ASP. And it can be compiled as an Apache module making it 10-20% faster. AND you can even add a flash memory cache making it even 40% faster than that. You can't compete with PHP in this manner.

  5. Syntax. If you are familiar with Perl, C, C++, java, javascript then PHP is a snap to learn because it uses similar functions. ASP is much different, takes a longer learning curve and requires support languages to get anything done.

  6. No additional languages required. Even though you may know ASP, it also requires you to use VB or Jscript as a support language (which also adds to the COM calls) . In PHP, you can do it all with one language.

  7. MySQL. This should be reason enough. Mysql 4.0 is an open sourced RDBMS and in recent independent benchmarks, ranked equivalent to Oracle 9i in the speed category. And PHP is MADE to work with MySQL. MySQL is the perfect web delivery tool and PHP is it's pimp. Can you feel the love? 🙂

  8. Community. Need to ask a question? Jump on any forum. Need a script? Just download one from sourceforge, freshmeat or a million other sites. Try getting this kind of support from ASP online. Hell, you can't even find good documentation on the MS site.

  9. Web Servers. If you are unfamiliar with Netcraft.com, it keeps statistics on the web and web servers. As of currently, 64% of the web runs Apache and since apache can't run ASP, PHP is the scripting language of choice. In comparison, 24% of the web runs Microsofts IIS and, I can attest to this, PHP runs on IIS just as well.

These should be reason enough to use PHP 🙂

    Originally posted by Spud_Nic
    Hiya

    Is there any comparison table anyone knows of, that lists PHP functions and rules/ways of doing things versus ASP equivalents?

    Like a side by side comparison of the equivalents?

    I'd be very interested if anyone knows of one!

    Cheers

    Heh, I wonder if that'd be heresy...

      Heh. Wanna talk heresy...

      I work for a company with very close ties to Microsuck (in fact we're right next door to them) and I run Apache, PHP, MySQL on a windows machine for the website. I'd go with Linux or BSD but management won't allow it for fear of what the 800-lb Gorilla next door might say.

      I've impressed quite a few people who didn't think I could get a AMP architecture to work so well on this but it does. Even got SSL working beautifully...heh.

      I'm planning for the day that some security breach wipes out everything and they decide to move everything to Linux... at which point, I'm rock solid 🙂

        Gee, talk about "side by side"....

        'Course, wouldn't that have to be at least 10 miles away, over the parks, gardens, swimming pools, tennis courts, running trails, woods, and finally the parking lots? 😃

          Nope... we're talking 'walk across the street and shake darth vaders hand'.

          Steve Balmer stops on by here every now and then... ran into him in the halls 🙂

            Heh... I was hiding in the crawl space. They don't think to look for me here. Heh.

            But seriously, I've had to fight long and hard to even get Apache, MySQL and PHP and fear the day some exec has a shit fit. But we are playing it safe and running it all off a Windows server.

            Our hosting company knows me as 'that guy whose running apache on windows'. I'm kind of an anomoly and they are amazed at what I am able to get up and running. Our last hosting company had all their tech support and cust support moved to india and they had the nerve to tell me that apache and php don't run on windows; I laughed and said they've been able to for years now... duh. But I do my best to go open source whenever possible and I've managed to sneak in quite a bit under the radar.

            I just wish I could be running on a more secure platform. But all it takes is one major hack or virus to take it out and then they more than likely will change their minds. 🙂

            As for Steve Ballmer, I've got four words for him:

            Developer, Developer, Developer, Developer!

            Old monkeyboy joke

              ASP using VBScript runs quite nicely on *nix and Apache with a 3rd party product.

              ASP can use MySQL as a backend database easily, much more easily than PHP on *nix can use MS SQL Server.

              ASP supports 2 scripting languages, VBScript and Javascript, plus you can add additional scripting languages like PerlScript.

              Being able to instantiate and use COM objects is a plus, not a minus. PHP offers this functionality too on a Windows environment.

              In my opinion, both asp and PHP are quite useful environments. asp.NET adds many more goodies to the mix. I confess though I was happy when my Windows web host recently added PHP support. Talk about the best of all worlds 🙂

                Originally posted by Doug G
                ASP using VBScript runs quite nicely on *nix and Apache with a 3rd party product.

                Yep... as per usual. Requires a third party app to make it cross platform. And it ain't free either. It's pricey. I think SUN makes it. Also, it's not a guarantee that all your scripts will work (especially if you are using VB as your support language). AND because it takes an additional app to make the conversion, it's a lot slower.

                And that does NOT make ASP cross platform. That just means that there is a tool out there to convert it.

                ASP supports 2 scripting languages, VBScript and Javascript, plus you can add additional scripting languages like PerlScript.

                Actually it supports more than those. But why use two or three languages when all you need is one? Hmmm... 🙂

                Being able to instantiate and use COM objects is a plus, not a minus. PHP offers this functionality too on a Windows environment.

                Yep, PHP sure does and it moves like a slug. Just as ASP does. You see, the more COM calls it makes, the longer the processing time for the script. Add another language and that ups the processing time. Add alot of complex functions and that ups the processing time. You may say that COM is a plus but you don't show HOW it's a plus. I've shown how it's a minus. Now it's your turn. 🙂

                In my opinion, both asp and PHP are quite useful environments. asp.NET adds many more goodies to the mix.

                LOL! .NET is microsofts answer to everything and we all know how much that flopped. Ever seen how Word turns a DOC into an HTML file? Try it some time. You will get a TON of bloat! A TON! And you expect .NET to be better than hand coding. I think not.

                Looks like we have a Microsoftie in disguise

                  See that's the great thing about PHP. It's FREE and better. It's like finding a twenty dollar bill with a hot chicks phone number on it 🙂

                  In fact, that should be PHP's slogan.

                    Hey foofoobar (nice name btw), if you want to try to argue by calling me a "Microsoftie" all I can say is you should try to find better facts to bolster your arguments 🙂

                    Your conclusions about COM are incorrect, trying to implement the functionality of most COM objects in a scripting environment (including PHP) is slower, not faster.

                    Your conclusion about the relative speed of asp vs. php is wrong. ASP and PHP are comparable in speed in my experience. I'm sure there is the mis-configured server or poorly-constructed app out there that can make it seem that one environment is better or worse than another.

                    I've been developing asp apps for years and php for a few months now. I like both. If however I'm gonna get ragged on anytime I try to be objective about technology I'll be happy to stay silent in the future.

                      Originally posted by Doug G
                      Your conclusion about the relative speed of asp vs. php is wrong. ASP and PHP are comparable in speed in my experience. I'm sure there is the mis-configured server or poorly-constructed app out there that can make it seem that one environment is better or worse than another.

                      You would be the first to think so. Just about all benchmarks of PHP vs. ASP have PHP leading by far. I have yet to see someone who doesn't work for Microsoft saying that .

                      For example, an independent test at ZDnet done way back in 2001 had PHP coming out clearly ahead in all tests... and this was in 2001 when compiling it as an apache module was still iffy.

                      Here's a direct quote from a writeup:
                      "During benchmarking, the same spec and identical cpu, memory boxes were used. Under identical conditions, it was found that PHP was the fastest - about 3.7 times faster than JSP and about 1.2 times faster than ASP. "

                      Keep in mind, this was 2001. Now PHP is MUCH faster than it was, the Zend engine is a speed demon in disguise and there are several added features, tweaks and tricks that make it EVEN FASTER!

                      I've been developing asp apps for years and php for a few months now. I like both. If however I'm gonna get ragged on anytime I try to be objective about technology I'll be happy to stay silent in the future.

                      Well you just have to have your facts straight is all. You address only the issues you wanted to of my original argument but don't supply benchmarks or proof while the PHP community has LOADS of proof as to the veracity of their claims.

                      Aside from that, ASP's poor memory management, a slough of add-ons that cost and several other factors make PHP better by far. Take a look at this writeup too.

                      http://forums.devshed.com/t56721/s3563741e890a51c2772ef9610fb0a152.html

                      Using ASP for years just means you haven't been turned on to the right tool yet... but you're learning.

                        And why waste the research I did in digging up all this stuff just on me. Go ahead and read all these comparisons for yourself...

                        http://www.greenside.demon.co.uk/home/mark/experience.html

                        http://php.weblogs.com/php_asp_7_reasons

                        http://www.greenside.demon.co.uk/home/mark/php/news.html

                        And this next one talks about how the Zend compiler wipes the floor with ASP (this last one was done with PHP as a CGI, NOT an Apache module so naturally ASP in it's native environment gets a slight edge). This however is the CLOSEST I have ever seen ASP come and I wanted to add this to show non-favoritism.

                        http://hotwired.lycos.com/webmonkey/99/51/index3a_page3.html?tw=programming

                          Moving this to a more appropriate forum. Be warned: once it's there fuzzy pink LART emissions will probably turn it into something else.

                            Dear Friend,

                            search in google.com for phpvsasp

                            you will get hundreds of notes

                            regards
                            bvsureshbabu

                              about 1.2 times faster than ASP

                              if that means 2.2 times as fast at that time, then PHP is surely much faster than ASP now.
                              But if that means 1.2 times as fast, then ASP's average speed may still be comparable to PHP (meaning time difference for similar scripts not all that noticeable to users), though much slower in actuality.

                                I think the 1.2 times faster number is from the linuxdocs PHP HOW-TO. That How-to is no longer available on the linux tldp site. I found it on various mirrors, the 1.2 times figure is measuring some kind of raw page outputs. Unfortunately all the links to benchmark specifics in the how-to copies were dead.

                                Specific benchmarks aren't that useful in the real world anyway, imho. One of ffb's links in this thread was a speed comparison of some kind of fractal math routine over many repetitions. Since I mostly do database small business sites that's not a speed comparison that means much in my world 🙂 To me, overall throughput and performance is much more important than some benchmark number from some specific controlled non-real-world test.

                                I do some development work with an open-source ASP bbs, I've evaluated many, many asp bbs's, and I've recently been looking at PHP bbs's. There is very little difference in speed between the various packages I've played with in a low-use environment, and I'm pretty convinced the biggest speed differential between packages is the dataase design, not PHP or ASP as the web server.

                                $0000000000.02

                                  Oh, I haven't ever heard this one. What's a "fuzzy pink LART emission" mean?

                                    Originally posted by Doug G
                                    Oh, I haven't ever heard this one. What's a "fuzzy pink LART emission" mean?

                                    See? It's begun already. The fuzzy pink LART doesn't even have to be present for it to have an effect. Ergo, it must be emitting something.