SitePoint Sponsor

User Tag List

Page 1 of 5 12345 LastLast
Results 1 to 25 of 120

Thread: Why php?

Hybrid View

  1. #1
    SitePoint Guru CompiledMonkey's Avatar
    Join Date
    Sep 2002
    Location
    Richmond, VA
    Posts
    975
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Why php?

    I notice soooo many people using php. Why? I'm into JSPs/Servlets and ASP.NET/C# myself. I enjoy each platform. I'm curious as to why PHP is such a hit. I can think of one easy reason, most every web host in the world supports it with mysql. Isn't php just a bunch of scripts in a page (ie: original asp)?

  2. #2
    Visible Ninja bronze trophy
    JeffWalden's Avatar
    Join Date
    Sep 2002
    Location
    Los Angeles
    Posts
    1,709
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    To be honest, the major reason I chose PHP as my language to learn is because the software free. I don't have the funds to pay for Microsoft products or even think about Macromedia.
    TAKE A WALK OUTSIDE YOUR MIND.

  3. #3
    SitePoint Guru CompiledMonkey's Avatar
    Join Date
    Sep 2002
    Location
    Richmond, VA
    Posts
    975
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's one reason I started with Java myself. Free is always good. Now that I've opened myself to consulting work, clients are willing to pay for items such as VS.NET and SQL Server. Hell, I'm happy with JSPs/Servlets, Apache/Tomcat, and MySQL. Great combo with little to no cost.

  4. #4
    Vermicious Knid moncur's Avatar
    Join Date
    May 2003
    Location
    Salt Lake City, UT
    Posts
    274
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You use the tools you have available, and PHP being available on most (Apache) servers is probably a major reason for it's popularity.

    These days, though, ASP, JSP, or PHP - or even Perl or Python - are available for just about any platform. Use the one that's comfortable for you. I use PHP because I know it inside and out and don't need to learn anything, but I'm sure I could accomplish the same things in another language if I needed to.

  5. #5
    ********* wombat firepages's Avatar
    Join Date
    Jul 2000
    Location
    Perth Australia
    Posts
    1,717
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    "I can think of one easy reason, most every web host in the world supports it with mysql"
    cheap hosting is perhaps a side effect, not the cause of PHP's current popularity.

    PHP had a rapid rise to popularity not because it had a good hosting base nor because it was free (i.e. PERL is free as well) but because it was an excellent solution to many web-scripters needs , much easier than PERL whilst at least as powerful as ASP (I am talking PHP3 days here btw)

    My first experiences with PHP were with postgreSQL or MSQL as the DB as MySQL hosting was pretty slim at that point.

    Developing smaller applications in PHP is a breeze compared to JSP/servlets + its faster than JSP/servlets no matter how fast JSP should be ..cos its slow regardless, + its far easier without losing any raw grunt etc etc.

    With essentials that came with PHP4 (session support!) many found that PHP could not only handle those small to medium sites but much larger ones as well , MySQL is only 1 of the databases that PHP supports and the fact it can talk to Oracle and its ilk made it a useful tool in larger more complex applications ... that said MySQL itself still continues to perform despite all the things that are supposed to be wrong with it.

    PHP5 with full OOP support should ensure PHP's continuing rise , yes its getting even better , very soon

    Isn't php just a bunch of scripts in a page (ie: original asp)?
    checkout class choice extends options{}
    if thats how you want to code it yes , if not then no , its up to the coder (I won't go to far into this as .NET'ters may have an attack of the vapours )

  6. #6
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Obviously coming from another language/environment altogether you have a severe lack of PHP understanding.

    This I can understand, though I would say that PHP if a lot lot more than simply 'a bunch of scripts in pages'.

    Why do I use it ? Simple really -

    1) It's open source and under constant developement from any number of angles
    2) It's a powerful scripting language offering just about any functionality that you can throw at it in terms of application development
    3) It's easy to learn and develop for
    4) It uses the Apache Web Server - for a lot of people this is the one real reason why they develop for PHP alone.
    5) With PHP5 about to be released as a stable language later this year, it's heading for the big time - far far more powerful than what CF has to offer at the moment IMO
    6) .NET is a closed Microsoft technology; where is your freedom to innovate I ask ?

    You could say the same for Java though.
    7) Freely available scripts and forums with an incredible feeling of community openness for PHP.

    Really, developers use PHP today in large numbers because it can provide a quick (relatively speaking compared to other languages) solution with the minimum amount of headache - there is an incredable community spirit as I stated above for PHP that apart from Java, no other language has this for developers.

    So .Net ? No thanks, as I'm going to continue to use the most powerful scripting language available to mankind today.

  7. #7
    SitePoint Zealot
    Join Date
    Dec 2001
    Location
    UK
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    - promotes Rapid Application Development (RAD)
    - quick and easy to learn
    - very widely supported (as with most Open Source projects)
    - constant stream of improvements and bug fixes, not determined by financially-focused, corporate steering committees!
    - extremely feature rich
    - powerful
    - fast
    - FREE!
    - and..and...*sigh*..just everything


  8. #8
    No. Phil.Roberts's Avatar
    Join Date
    May 2001
    Location
    Nottingham, UK
    Posts
    1,142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you're into Java/Servlets then PHP is a very logical step, as it has the ability to integrate with Java components. Its very possible to use Servlets for the 'core' of your coding, and use PHP to form the user interface. Thus gaining points from the sheer speed of PHP, without losing the power of Java.

  9. #9
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    The reason PHP is more popular over more advanced programming frameworks, like Java or .NET (and more recently ColdFusion, in it's MX variant) is that it's so extremely available on many levels:

    1. It's VERY easy to learn.

    2. It has an fabulous developer community (which means hogloads of tutorials, forums, existing code and extensions)

    3. PHP/mySQL hosting is very cheap
    This is not so much due to PHP itself being free, but due to the fact that it's "default" environment (Linux, Apache, mySQL) is a free OS, a free Web server, and a free DB serve. Java and .NET generally requires more expensive stuff to run optimally. With that said, I resent hyperboliks notion that it's more expensive to develop .NET than PHP, which is untrue - all the needed development tools are provided for free by Microsoft, except for Windows itself.

    Quote Originally Posted by torrent
    - powerful
    - fast
    I don't really think those two holds water as primary reasons why people choose PHP, as both .NET and Java (and therefore ColdFusion MX) are (arguably) both faster and more powerful.

    6) .NET is a closed Microsoft technology; where is your freedom to innovate I ask ?
    Well, you can look at the open and released source code of the .NET CLR and implement an entire friggin' .NET framework for Linux.
    Mattias Johansson
    Short, Swedish, Web Developer

    Buttons and Dog Tags with your custom design:
    FatStatement.com

  10. #10
    SitePoint Zealot
    Join Date
    Dec 2001
    Location
    UK
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by M. Johansson
    I don't really think those two holds water as primary reasons why people choose PHP, as both .NET and Java (and therefore ColdFusion MX) are (arguably) both faster and more powerful.
    Okay, but back in the real world... We have used Java, PHP, and ASP technologies in a commercial environment. I personally also develop (to an admittedly lesser extent) in CFMX. If you truly believe Java and ASP are "arguably" faster than PHP then you need to take a look at using performance monitoring tools to assess processor load, and memory/paging requirements of them all. We have done this internally in a 6 month, fairly exhaustive, load intensive trial. Our findings were that Java created a large server overhead, especially with regards to memory usage. However, ways were implemented to optimise this and eventually we got, what we considered, to be reasonable performance under load from it. As for ASP, the fact that it is constantly context switching in and out of the HTML parser in order to select the compiler, means by its very nature that it will be slower than PHP in execution (not to mention more resource intensive on the server). This proved to be the case. ASP was, in our tests, considerably slower than PHP. We didn't use .NET btw.

    As for Coldfusion, well, I found that CFMX was fabulous for doing the quick and easy tasks as it has some pretty neat functions. However, when you wanted to do something a little more complex then it became a bit of a trial. For example, regular expression support is abysmal, as is developing socket based interfaces (a common requirement for us). Speed wise it was quite impressive, bettering PHP in some areas, but not in others. Overall though we were very unimpressed with Macromedia's support and questionable product direction.

    As an organisation, we took a corporate decision to use Java and PHP where web management tools were being created (for a particular bespoke product we supply), depending on what the size, complexity, and nature of the tool implementation would be. It helped also that PHP can call and use Java objects and methods.

    I'd be interested to hear what evidence you based your views on.

    Oh, if anyone is interested we also ran a load and destruction test study against Oracle, MySQL, local HSAM, and local ISAM databases (didn't have the means at the time to include MS SQLServer).

  11. #11
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You are definetly more experienced than me, and if you have done first-hand testing, it's more valid than my views, which are mostly based on benchmarks that I have seen. It's unfortunate that you did not include .NET in your testing, as I'm yet to see any decent comparison between it and PHP.

    What was your conclusion on Java and PHP, speed wise? Is PHP faster, and if so, by how much?

    Oh, and doesn't CFMX run on top of Java nowadays, or something like that?

    edit- also, for the record, I never said that ASP was faster than PHP. None of the testing I have seen have indicated that at all.
    Mattias Johansson
    Short, Swedish, Web Developer

    Buttons and Dog Tags with your custom design:
    FatStatement.com

  12. #12
    SitePoint Wizard silver trophy redemption's Avatar
    Join Date
    Sep 2001
    Location
    Singapore
    Posts
    5,269
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeap I would also be interested to see your benchmarks.

    Which container/app server did you use to test your Java applications? WebLogic? J2EE RI? Or just Apache linked with Tomcat?

    How did you reconcile a fair benchmark test when Java app servers are built to scale for large complex applications, but are overkill for simple web scripts, with PHP's speed in web scripting?

    I agree that Java app servers have large memory consumption, but they do much more. That said, this is after all a web development forum so little would people here be compelled to switch to Java server programming. If anyone is interested in being an enterprise developer though, J2EE and .NET are the 2 bandwagons you should jump on. PHP doesn't cut it yet, though integration with Java is a big step.

  13. #13
    SitePoint Zealot
    Join Date
    Dec 2001
    Location
    UK
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Regarding the exact details of the testing environments, I would have to find that out as I was not directly involved with actual trials. My involvement came when I (as a Senior Project Manager) was scoping out the work involved for a project in the Middle East, I read a report on which technologies are being endorsed by our company for web development purposes. The concensus was, as Redemption summised, that Java was the way to go when needing to follow good MVC methodology and producing an Enterprise wide solution and that PHP was deemed (by our company at least) the way to go when requiring RAD. PHP5 may address some of PHP's short comings with regards with to Enterprise solutions, although I still doubt it will be a match for J2EE in that environment.

    I'm not sure we'd ever get round to testing against .NET as we pretty much require platform independent code (another thing that went against ASP as Chillisoft doesn't cut the mustard). Can .NET run on non-MS Windows servers? I don't think it can (my knowledge of .NET is extremely limited)?

  14. #14
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by torrent
    I'm not sure we'd ever get round to testing against .NET as we pretty much require platform independent code (another thing that went against ASP as Chillisoft doesn't cut the mustard). Can .NET run on non-MS Windows servers? I don't think it can (my knowledge of .NET is extremely limited)?
    Ximian is currently working on the Mono Project, which is essentially .NET for Linux. They are making marvelous progress, but I'm not sure whether it is ready for production yet.

    http://www.go-mono.com
    Mattias Johansson
    Short, Swedish, Web Developer

    Buttons and Dog Tags with your custom design:
    FatStatement.com

  15. #15
    SitePoint Wizard silver trophy redemption's Avatar
    Join Date
    Sep 2001
    Location
    Singapore
    Posts
    5,269
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is the Mono project which is, and I quote, "is an open development initiative sponsored by Ximian that is working to develop an open source, Unix version of the Microsoft .NET development platform."

    I have no experience with it, nor much experience with .NET itself so I can't comment on it.

    [EDIT] slower than Mattias

  16. #16
    SitePoint Zealot
    Join Date
    Dec 2001
    Location
    UK
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just looking at the link you posted now.
    V. interesting. Tx both for that.

  17. #17
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,123
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    While torrent's opinion may be based on experience, most of his list is contained in other languages. Sure, they are reasons to pick PHP, but most of his short list aren't reasons to pick PHP over any other language.

    I still love the fact that "free" is thrown in there. Some people mock my viewpoint that free isn't free. Well, this week we gave Linux a shot. We needed to put a new firewall in, so were going to need to pay no matter what, perfect opportunity to give it a shot.

    Got a new server, got Linux installed and then gave the team 20-40 hours to do configuration and tweaking. At the 40 hour mark it would have been cheaper to buy a high-end firewall solution. At the 100 hour mark it would have been cheaper to buy a firewall appliance.

    The team, yesterday, hit the 100 hour mark and it still isn't working properly. Certainly part of this is due to me giving them the freedom to fail (which is important since one of the developers is a Linux "advocate" and he never believed me that Linux isn't always cheaper).

    That said, the original poster is coming from a .NET environment, so others should try and give him reasons why PHP is a benefit to him where he's at. He's not coming from an ASP or CFM environment so much, and so needs to be given advantages over Java and .NET. Don't worry, there are those advantages, the main one being that by and large PHP can be quicker to develop for on smaller projects and websites.

    J

    ps: pfft @ PHP encouraging RAD, it encourages exactly the opposite by the fact that it still allows old, antiquated and useless code while "enabling" new advances such as OOP. Having these as an option means new developers will almost always pick the simplest route, which is always the dirtiest one.
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  18. #18
    SitePoint Wizard silver trophy redemption's Avatar
    Join Date
    Sep 2001
    Location
    Singapore
    Posts
    5,269
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Jeremy W.
    ps: pfft @ PHP encouraging RAD, it encourages exactly the opposite by the fact that it still allows old, antiquated and useless code while "enabling" new advances such as OOP. Having these as an option means new developers will almost always pick the simplest route, which is always the dirtiest one.
    I agree, with the word being thrown around, I think it should be made clear what RAD (Rapid Application Development) means. I picked this up from a site (don't worry, it isn't copyrighted content)
    RAD (rapid application development) is a concept that products can be developed faster and of higher quality through:

    * Gathering requirements using workshops or focus groups
    * Prototyping and early, reiterative user testing of designs
    * The re-use of software components
    * A rigidly paced schedule that defers design improvements to the next product version
    * Less formality in reviews and other team communication
    In PHP, apps are developed faster, yes, but not often of higher quality.

  19. #19
    SitePoint Member
    Join Date
    May 2003
    Location
    UK
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Got a new server, got Linux installed and then gave the team 20-40 hours to do configuration and tweaking. At the 40 hour mark it would have been cheaper to buy a high-end firewall solution. At the 100 hour mark it would have been cheaper to buy a firewall appliance.
    Maybe you should employ people that know what they're doing? - just a thought.

  20. #20
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,123
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I'm sorry, which part of the story infers that the team were without skills or not up to the task?

    J
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  21. #21
    SitePoint Zealot
    Join Date
    Dec 2001
    Location
    UK
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would say that typically the "quality" of the code is down to the "quality" of the developer. In any language. Choose a strong developer who understands good-practice methodologies (such as MVC), and you will produce good quality code. Any poor workman can blame his tools (or his employees)

  22. #22
    SitePoint Wizard silver trophy redemption's Avatar
    Join Date
    Sep 2001
    Location
    Singapore
    Posts
    5,269
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by torrent
    I would say that typically the "quality" of the code is down to the "quality" of the developer. In any language. Choose a strong developer who understands good-practice methodologies (such as MVC), and you will produce good quality code. Any poor workman can blame his tools (or his employees)
    I think what Jeremy (and I actually) are getting at is that some tools are better than others. With PHP, it is difficult to have good practices (evident in many projects). With Java and .NET, a certain foundation is there, though of course it can be misused.

    With the Linux firewall, it would be more difficult to setup and cost a company in terms of the time used (which is money). With a high-end firewall solution, you often get a solid product and support, but if you don't have good practices, the firewall might as well not be there.

  23. #23
    SitePoint Member
    Join Date
    May 2003
    Location
    UK
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm sorry, which part of the story infers that the team were without skills or not up to the task?
    Your post refers to the predictable age old Microsoft quote of "Linux is free if your time is worth nothing" This is all a bit boring and old fashioned now, the fact of the matter is the software is free and a lot of the time better than the paid for competition. Why Microsoft people have a problem with free software is beyond me and I can only assume they feel threatened by it. You cannot seriously say Linux isn’t free because it took your workers over 100 hrs to configure. If that is the norm I cannot understand why so many businesses use Linux as a solution and more are moving. If you are going to mention time being wasted when configuring Linux it’s only fair we mention all the time that gets wasted when Windows – crashes, needs re-booting, sorting out security breaches/ problems and numerous other bugs that come standard with all of Microsoft’s products. And of course Windows isn’t free and isn’t Open Source.

  24. #24
    SitePoint Member
    Join Date
    May 2003
    Location
    UK
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    With PHP, it is difficult to have good practices (evident in many projects).
    I think that is very unfair. PHP's OO support is good enough and is getting better. It has already been mentioned but the quality of the project comes down to the developers.

  25. #25
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mbb
    I think that is very unfair. PHP's OO support is good enough and is getting better. It has already been mentioned but the quality of the project comes down to the developers.
    No, it's not unfair. The problem is not PHP lack of OO features - it definetly has most of the required features if you are willing to do some workarounds. The problem is that the OO is not forced in the same way that they are with Java/.NET, allowing for sloppy code to a whole other extent than with aforementioned languages.
    Mattias Johansson
    Short, Swedish, Web Developer

    Buttons and Dog Tags with your custom design:
    FatStatement.com


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •