SitePoint Sponsor

User Tag List

Results 1 to 24 of 24

Thread: Why PHP?

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Jun 2007
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Why PHP?

    Hello PHPers. This is my first time back to these forums in a number of years, as I am currently working on starting a business designing and developing web applications.

    I've been immersing myself in all the new technologies that have cropped up for the web over the last three to four years (I was stuck doing backend work, and haven't touched a "real" web site in years...all I ever did was write REST APIs with MVC.) My background is in C#, .NET, and ASP.NET MVC. I feel I have a LOT of power in these technologies, especially when combined with newer tools and platforms like HTML5, CSS3 (+Less), Twitter Bootstrap, etc. I am also intimately familiar with all of the .NET platforms libraries, both official and third party, as well as extremely well versed in C#...so it takes little effort to code apps on that platform. Combined with WinHost (which clocks in at $4.11/month), it has become a very cost effective platform for the power it offers.

    It seems that the two real giants in web development, however, are PHP (still...its been big since the early 2000's) and Ruby. As someone who aims to offer my services to as many customers as possible, I've begun looking into PHP and possibly Ruby as alternative platforms, just in case a customer insists on hosting on a server other than windows. My question about PHP is, quite simply, why? What draws so many developers to use PHP over something else, such as Java or .NET? What are the benefits over other technologies? What are the drawbacks? In terms of capability, how does it fair? In terms of ease and rapidness of development, how does it fair? Why choose PHP over Ruby? How cheap is hosting for PHP?

    These are honest questions. I would particularly like to know in comparison with Ruby as well, as that seems to be the other major alternative (although Node.js seems to be flying high with popularity right now as well...however I am not sure I want to use JavaScript as my primary or sole development language for everything...) Well, thank you for your responses!

  2. #2
    Patience... bronze trophy solidcodes's Avatar
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    936
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Because PHP is FREE.

    Because PHP is use by 90% of web hosting companies, around the world.
    Which is not the case for .NET or Ruby.

    PHP is robust and easy to learn.

    I know asp is free too but .net is not.
    Quality codes are optimized and tested...
    Click here for inspiration..

  3. #3
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,169
    Mentioned
    153 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by solidcodes View Post
    Because PHP is FREE.

    Because PHP is use by 90% of web hosting companies, around the world.
    Which is not the case for .NET or Ruby.

    PHP is robust and easy to learn.

    I know asp is free too but .net is not.
    To be fair, .NET is FREE too. You don't have to buy Visual Studio to develop in it, it is freely available for download/installation, you do have to buy a license of Windows Server to host it though, but .NET itself, is FREE (and you can technically host it on other platforms through Mono).

  4. #4
    SitePoint Member
    Join Date
    Oct 2013
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Php it's like a tool that gives you everything and all features by little investment in terms of time, energy and money. but one bad thing about php , it is not well decorated or organised language compare to java , .net, that irritates me . Still way better than doing 100 lines of coding ,when it can be done in 40 - 60 lines using php

  5. #5
    SitePoint Wizard silver trophybronze trophy asp_funda's Avatar
    Join Date
    Jun 2003
    Location
    ether
    Posts
    4,497
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by amit11 View Post
    but one bad thing about php , it is not well decorated or organised language compare to java , .net, that irritates me
    Ultimately the code structure etc comes down to the person writing the code. I've seen some crappy code written in Java as well, its not Java or PHP or any other language's fault.
    Our lives teach us who we are.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Me - Photo Blog - Personal Blog - Dev Blog
    iG:Syntax Hiliter -- Colourize your code in WordPress!!

  6. #6
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,169
    Mentioned
    153 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by asp_funda View Post
    Ultimately the code structure etc comes down to the person writing the code. I've seen some crappy code written in Java as well, its not Java or PHP or any other language's fault.
    I'll second that and just throw out the following tidbit to symbolize it isn't the language, it is the developer, as the last project I've been working on over the past 18 months had what was called a "StringCalculator". Yes, it does exactly what it sounds: Given "1 + 1" as a string it would return 2. Don't ask me why on earth anyone would do that in a language that already supports mathematical operations. Needless to say, it was the very first thing I ripped out.

  7. #7
    SitePoint Wizard silver trophybronze trophy asp_funda's Avatar
    Join Date
    Jun 2003
    Location
    ether
    Posts
    4,497
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cpradio View Post
    last project I've been working on over the past 18 months had what was called a "StringCalculator". Yes, it does exactly what it sounds: Given "1 + 1" as a string it would return 2.
    rofl, been a while since I last saw/heard about idiotic code that made me laugh instead of infuriate me!
    Our lives teach us who we are.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Me - Photo Blog - Personal Blog - Dev Blog
    iG:Syntax Hiliter -- Colourize your code in WordPress!!

  8. #8
    Barefoot on the Moon! silver trophy Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,606
    Mentioned
    56 Post(s)
    Tagged
    1 Thread(s)
    1) Most inexpensive hosting providers offer LAMP stacks.
    2) Documentation and community support is another big reason why PHP remains popular. Other languages lack in this a little bit.
    3) It's been around for a long time and has a solid foothold in the development community.
    4) It has a low bar to entry.
    Visit The Blog | Follow On Twitter
    301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
    Can be hosted on and utilize your own domain

  9. #9
    Patience... bronze trophy solidcodes's Avatar
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    936
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    @cpradio ;

    Sorry, I did not know it's free too.
    Thanks for correction.
    That's the advantage of PHP I guess It can be hosted on LAMP, which is free.
    Quality codes are optimized and tested...
    Click here for inspiration..

  10. #10
    SitePoint Member
    Join Date
    Oct 2013
    Location
    Cordova, Cebu
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In my humble opinion...

    1. PHP is easy to learn
    2. PHP is open-source
    3. You can easily deploy your PHP-based applications to most hosting companies
    4. Hosting is cheap
    5. PHP is matured compared to other scripting language like Ruby
    6. Great community

  11. #11
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,169
    Mentioned
    153 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by solidcodes View Post
    @cpradio ;

    Sorry, I did not know it's free too.
    Thanks for correction.
    That's the advantage of PHP I guess It can be hosted on LAMP, which is free.
    No worries, it is a common misconception everyone has about .NET since it is a Microsoft Technology. Just for kicks and giggles, I'll play devil's advocate and list reasons why .NET may be preferred
    1. Strongly tied to OOP, so you are forced into learning good practices, patterns, etc.
    2. Well thought out life cycle implementation for building pages (makes you think along more of MVC and MVP practices)
    3. If you have any experience in lower level languages, C, or C++, or even Java, transitioning to C# is dead simple
    4. Compile errors/warnings give you a hint at where your code may fail (or will fail)
    5. Can be used to develop Mobile and Desktop applications as well as Web
    6. Several libraries built in for you to do common tasks (email, caching, parallel activities, etc)

  12. #12
    SitePoint Wizard silver trophybronze trophy asp_funda's Avatar
    Join Date
    Jun 2003
    Location
    ether
    Posts
    4,497
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cpradio View Post

    1. Can be used to develop Mobile and Desktop applications as well as Web
    2. Several libraries built in for you to do common tasks (email, caching, parallel activities, etc)
    Can be said the same for PHP (desktop yeah, not 100% sure on mobile native apps)
    Our lives teach us who we are.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Me - Photo Blog - Personal Blog - Dev Blog
    iG:Syntax Hiliter -- Colourize your code in WordPress!!

  13. #13
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,169
    Mentioned
    153 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by asp_funda View Post
    Can be said the same for PHP (desktop yeah, not 100% sure on mobile native apps)
    Maybe so, but you can't say it is stable and mature like you can for .NET. Desktop apps created by PHP are still in their infancy stage, in fact, most of the development behind them dies after a year or two (then another one crops up).

    As for the libraries, I've yet to find a nice parallel library that comes close to matching the power of the .NET one. I honestly don't think it exists...

  14. #14
    SitePoint Wizard silver trophybronze trophy asp_funda's Avatar
    Join Date
    Jun 2003
    Location
    ether
    Posts
    4,497
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cpradio View Post
    Maybe so, but you can't say it is stable and mature like you can for .NET
    No I can't; .Net was made with that as primary purpose, PHP was made to run on the web, both of them excel at what they were primarily made for.

    Quote Originally Posted by cpradio View Post
    Desktop apps created by PHP are still in their infancy stage
    Hah, they've been so for ages. PHP GTK is still alive if somewhat, then there are some others like phpdesktop etc.

    Quote Originally Posted by cpradio View Post
    As for the libraries, I've yet to find a nice parallel library that comes close to matching the power of the .NET one. I honestly don't think it exists...
    pthreads is quite good from what I've read, its a native pecl ext. Google have their own implementation as Task Queues on App Engine. A lot of people use their own home-grown libs which use exec() to run background processes when they want to do multi-threading. Personally I think if I need async/multi-threading then Node.js would be better than anything else.
    Our lives teach us who we are.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Me - Photo Blog - Personal Blog - Dev Blog
    iG:Syntax Hiliter -- Colourize your code in WordPress!!

  15. #15
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,182
    Mentioned
    66 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by cpradio View Post
    As for the libraries, I've yet to find a nice parallel library that comes close to matching the power of the .NET one. I honestly don't think it exists...
    It doesn't. PThreads looks to show some promise but I haven't tried it yet. I can't wait to gain a full understanding of GoLang which masters it.

  16. #16
    SitePoint Member
    Join Date
    Jun 2007
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    First off, thank you everyone for your replies. Sorry for my late response, I was having trouble with the forum for a little while there...seems to be ok now.

    Anyway...

    Quote Originally Posted by solidcodes View Post
    @cpradio ;

    Sorry, I did not know it's free too.
    Thanks for correction.
    That's the advantage of PHP I guess It can be hosted on LAMP, which is free.
    It should be noted that .NET is indeed free. When you have been using the Microsoft stack for a long time, pretty much everything from Microsoft ends up being "free" in one way or another, or extremely cheap. I think I have access to everything from Microsoft except their top-end editions of Visual Studio Ultimate and the related tools, however I don't need advanced integrated UML modeling or anything like that for what I do.

    I am curious about the notion that "PHP can be hosted on LAMP, which is free." I understand that the LAMP stack uses free technology...however...unless you have your own fixed IP and are running your own servers, you still have to pay for actual LAMP stack hosting, correct? I mean, there aren't free high bandwidth offerings on the LAMP stack, are there? It used to be that hosting on Linux was cheaper than hosting on Windows, however with services like WinHost, where a 50Gb transfer/mo is only $4.11, and 200Gb transfer/mo is only $9.97...it seems that advantage has disappeared. If there is literally free, high bandwidth LAMP stack hosting, then that would be intriguing... On the other hand, if LAMP hosting is still just "cheap", I wouldn't call that an advantage these days.

    Anyway, in addition to these reasons:

    Quote Originally Posted by cpradio View Post
    No worries, it is a common misconception everyone has about .NET since it is a Microsoft Technology. Just for kicks and giggles, I'll play devil's advocate and list reasons why .NET may be preferred
    1. Strongly tied to OOP, so you are forced into learning good practices, patterns, etc.
    2. Well thought out life cycle implementation for building pages (makes you think along more of MVC and MVP practices)
    3. If you have any experience in lower level languages, C, or C++, or even Java, transitioning to C# is dead simple
    4. Compile errors/warnings give you a hint at where your code may fail (or will fail)
    5. Can be used to develop Mobile and Desktop applications as well as Web
    6. Several libraries built in for you to do common tasks (email, caching, parallel activities, etc)
    I also have the advantage of ASP.NET MVC 4, which has the (absolutely WONDERFUL!) Razor view engine, as well as the Web API framework. When it comes to developing web sites and apis, I've rarely seen such well thought out frameworks that make rapid, clean, stable code development so easy. I pretty much live and die by MVC, the separation of concerns there is critical to maintainability in my opinion. Does PHP have anything similar? When I see PHP code, it usually reminds me of old ASP (classic!) code. Monolithic, interleaved code + view, which doesn't gain the benefit of the nice separation of concerns that a proper MVC framework offers. Given that PHP has been around about as long as ASP Classic (~1995), I figure there must be some decent MVC or maybe MVP (not quite as good) frameworks for it. I guess I don't think I could consider PHP without the MVC option...so if I had to ask for any single framework, MVC would be it! :P

    I could probably live with a JavaScript alternative if PHP does not have anything resembling MVC...there are some pretty good template rendering engines for JS now, including JQuote2, Bliss (Razor-like JS view engine, very nice), and a few others. Sometimes, however, the ability to process on the server, cache at the server, offers capabilities you just don't have on the client.

    Anyway,

  17. #17
    SitePoint Addict bronze trophy
    Join Date
    Apr 2013
    Location
    Ithaca
    Posts
    351
    Mentioned
    6 Post(s)
    Tagged
    1 Thread(s)
    Why asking a question like this on a PHP forum/section?

  18. #18
    SitePoint Member
    Join Date
    Sep 2013
    Location
    Chennai
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I prefer PHP because it has more benefits they are
    open source
    object oriented
    cross platform
    scalability
    flexibility
    easy to use
    easy to understand
    easy to learn
    easy to fix problems
    free of cost
    supports all major web server
    supports all major database
    Good PHP community
    More security
    More faster
    easy integration
    easy deployment and so on.

  19. #19
    Barefoot on the Moon! silver trophy Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,606
    Mentioned
    56 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Luca tall View Post
    I prefer PHP because it has more benefits they are
    open source
    object oriented
    cross platform
    scalability
    flexibility
    easy to use
    easy to understand
    easy to learn
    easy to fix problems
    free of cost
    supports all major web server
    supports all major database
    Good PHP community
    More security
    More faster
    easy integration
    easy deployment and so on.
    Many of these are subjective and not necessarily unique to PHP.
    Visit The Blog | Follow On Twitter
    301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
    Can be hosted on and utilize your own domain

  20. #20
    SitePoint Wizard silver trophybronze trophy asp_funda's Avatar
    Join Date
    Jun 2003
    Location
    ether
    Posts
    4,497
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jrista View Post
    What draws so many developers to use PHP over something else, such as Java or .NET?
    I'd say (from my experience), PHP has a much lower bar to entry than Java, .Net, Ruby, Python. The only alternative to PHP I've seen which is as easy to get going is Node.js where you write Javascript which runs on the server. Though the performance boost that Node.js can offer can pretty quickly outstrip PHP (say when being run under fcgi w/ nginx) once you start to take heavy load & scale (from what I've read - I'm yet to test/see this myself).

    Quote Originally Posted by jrista View Post
    How cheap is hosting for PHP?
    I personally wouldn't go for a language just because its the cheapest to host. These days, the cost difference is negligible, most decent quality hosts would provide PHP & Ruby out of the box, a lot of them would also throw in Python in the same plan.
    Our lives teach us who we are.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Me - Photo Blog - Personal Blog - Dev Blog
    iG:Syntax Hiliter -- Colourize your code in WordPress!!


Tags for this Thread

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
  •