15 ms·
Leaving PHP is too expensive
- deleted 11y ago[deleted]
- Mahn 11y ago> Laravel Forge is a service that for $9 a month they will provision unlimited production ready php servers (install, setup and configure) and you can control it all from a web interface. So, perhaps I'm missing something here, but how is this economically viable for Lavarel?
- developer2 11y agoYou didn't finish reading the article. The $9 gets you unlimited setup/configuration/management of servers and projects. You separately pay for the servers at your host of choice. His example is the $9 at Laravel Forge + $10 server at Linode. The $9 is a convenience package for managing things, not including the cost of hosting itself. Of course if your load is small, you can host multiple projects on a single server. So you don't need to pay for a $10 Linode per project, unlike what people do with Heroku where you pay the full hosting cost per project.
- JonoBB 11y agoYou pay separately for the servers of course. Forge is just a provisioning / deployment tool
- patmcc 11y agoYou still pay for the servers - they can be AWS, DigitalOcean, etc. - Forge handles deployment, provisioning, and all that jazz.
- jonlucc 11y agoThey don't handle the hosting, just the provisioning. I assume it's almost entirely automated until they're adding new features or one of the supported hosts breaks something.
- dubcanada 11y agoYou provision servers you buy from other services like Digitalocean.
- mschuster91 11y agoPHP, for all its faults, enjoys one advantage over, basically, everything else: SCALE. People have figured out how to build dead cheap mass hosting in PHP. You can support next to infinite numbers of small projects on a single apache+mod_php server - as long as they don't get many visitors you're fine. NodeJS, Java or other hipster languages will require one instance of a runtime for each project that runs. Also, the problems of how to host and develop PHP project have been solved - for a hoster it's usually enough to tell people "here's your ftp, here's your mysql access data, have fun". No other environment (except static HTML of course) comes anywhere close to that.
- lotyrin 11y agoScalable but slow. CGI model of execution and everything being synchronous throws away too much effort that could have been shared between requests or spread across CPU cores. Best case scenario, you have to tie your app in knots and come up with arcane cache keying/invalidation strategies to be able to cache exactly the right things, then you still have to make multiple round-trips to a cache service per page (unless every page is identical or every page is entirely unique), and PHP just twiddles its thumbs waiting on the network for each one, one after the other.
- icebraining 11y agoNo, Java web application servers like Tomcat can run multiple sites/apps on a single instance of the JVM.
- iofj 11y agoSince I know that's actually true, why are there so few hosters actually doing that ? I mean, I get that there's no money in it for Oracle, so it's certainly not a priority for them, but still, it should work.
- StreamBright 11y agoNodeJS and Java as hipster languages? I think there is a lot of enterprise effort put into those VMs to make the code execution fast behind those "languages", more like programming environments. PHP does not have any advantage over Java or even NodeJS as far as language syntax goes, but it offers less in terms of instrumentation and other much needed features of making production ready code.
- ddorian43 11y agoSo the whole point is shared hosting ? Use https://www.webfaction.com/?aid=9281 https://www.webfaction.com/?aid=9281 (affiliate link so I don't pay for my own account), it is best-host in the world and also does your django,nodejs,rials,postgis,redis,whatever stuff.
- sergiotapia 11y agoWebFaction is so good, I don't know why they aren't more popular.
- donutdan4114 11y agoI've been really liking PHP lately. PHP 7 has awesome new features and performance improvements. Of course, PHP isn't right for every application, but I feel like PHP needs to be taken more seriously, compared to Ruby and Python, for large-scale applications, and fast-response web services. It's hard to break an old stigma.. but.. PHP7 is NOTHING like PHP4, and a LOT better than PHP5.x.
- karnajani 11y agoTotally agree. PHP7's speed is awesome. And the service that the author points out (Laravel Forge) provisions VPSes with PHP7. The author is totally right about Forge, I have never EVER had a better provisioning experience.
- meddlepal 11y agoThis may very well be true (I haven't written PHP since the era of 4/5-beta), but it's probably going to be a lot like Java in the sense that the older devs scarred from Java 1.0 - 1.5 basically want nothing to do with it anymore and rant and rave about the language despite the language and ecosystem evolving considerably.
- andreygrehov 11y agoAgree. PHP 7 is indeed a pretty decent language. At the same time, it's worth checking out the Hacklang[1], which looks even more interesting than PHP 7. I wonder how many people tried Hack on production. [1] http://hacklang.org/ http://hacklang.org/
- thrownear 11y ago>PHP 7 has awesome new features and performance improvements "Awesome new features" does not make up for the rotten core that remains. It never will. So please, don't be fooled by the additions to the language (Which by the way has a history of being poorly built and does not fit well with the rest of the language). So Php 7 is still Php and all it implies. A language that no one should be unfortunate enough to use in 2016. Case in point [1]. [1] https://www.reddit.com/r/lolphp/comments/41fqib/it_is_so_simple_in_php_let_me_show_you_mm_no_it/ https://www.reddit.com/r/lolphp/comments/41fqib/it_is_so_sim...
- epx 11y agoPHP has batteries included. For almost everything you can imagine doing, from image manipulation to send e-mail, there is some (poorly conceived) API. And, coupled to Apache MPM or equivalent, it offers a very simple model of development with good scalability. A PHP script can work top-to-bottom, as if it were the only thing in the Web server, and MPM will run that script in any number of parallel instances. Many, many developers can't grasp more complex models e.g. Node.js asynchronous. So there is impedance match between some average programmer with a good idea to implement, and the tool. Given these factors, people start some prototype in PHP, and one day the prototype becomes a major product, and rewriting it is prohibitively expensive.
- chias 11y ago> For almost everything you can imagine doing, from image manipulation to send e-mail, there is some (poorly conceived) API. My favorite example of this: http://php.net/manual/en/function.gzgetss.php http://php.net/manual/en/function.gzgetss.php It tickles me seven shades of pink that this function is built into the language.
- kentt 11y agoIs the point of this article is that hosting non-php sites is too expensive or difficult? That really isn't true. If you just need to get a LAMP stack there's thousands of inexpensive options. If you want to something free and scalable like heroku, openshift would work.
- deleted 11y ago[deleted]
- true_religion 11y agoHeroku's free tier seems to be built for hobby or small scale projects. All it requires is that your application not receive traffic for at least 6 hours per day and have less than 10,000 rows in the database. Granted it is easy to go past these limits, but it is also very easy not to. Lots of school projects have no need for this. Most hobby sites really don't need to be up 24/7. Generally, if you aren't making money from it, you have to question: does it need to be live 100% of the time? If not, then Heroku is great and you pay $0.
- update 11y agohm. i started using python instead of php as soon as i discovered web.py. >'Leaving PHP is too expensive' seems the opposite in my experience.
- deleted 11y ago[deleted]
- ultramancool 11y agoYou can do the same for even less money and with any language - $5/mo digitalocean box and a quick hack ansible script to deploy. Maybe if you really don't understand the ops side of things you won't like even writing a little ansible script, but heck, I'd do it just to save $14/mo over this guy's scheme. I think understanding the ops side of things on your own small scale sites is quite useful sometimes though.
- arien 11y agoExactly, I think DigitalOcean is a great and unexpensive option here. The thing is, you really don't need a whole box for each of your small projects, most likely you will be able to have a few in one box, specially in the beginning with not much traffic. So, start small and then move onto bigger things if things look promising. Use something like Dokku for easy deployment if Ansible or others are too much work. Every little bit will help when you do need to scale.
- JonoBB 11y agoWhat about firewall config? What about installing SSL certs? What about subdomains? What about queue workers? Cron jobs? The whole point of the article is that those items are completely beyond many devs. Yes, you could learn to do it yourself, but its just so much easier to get started with a service like Forge.
- arien 11y agoThere are tons of runbooks in DigitalOcean's community, or Webfaction's or whatever else that guide you step by step on how to configure things. It's a matter of choice, you can spend some extra money and have those things handled for you or you can save it and do it yourself (perhaps just once if you use some config management tool to save your settings). P.S. It's also worth asking oneself, are these things really required for my small, personal projects? Perhaps they aren't and you can save yourself both time and money.
- ultramancool 11y agoI don't know, maybe I'm not representative of most developers as I do devops for my side businesses, but I feel like I don't understand a technology well enough until I can handle both the development and the ops side and the ops side often feels like a prerequisite for properly handling the dev side.
- EugeneOZ 11y agoThinking "PHP is enough" and not trying/learning new things - that what is much more expensive.
- vinceguidry 11y agoWhy wouldn't PHP be enough? It solves problems, you can make money with it, what more do you want? I use Ruby, and I see zero reason to venture outside of my domain. I can happily keep using and learning and diving deep into Ruby for the rest of my career. I used to worry that I'd eventually become obsolete, but languages do not really go away. People still make fine livings coding in Fortran. There is a world outside of code, you know.
- jeena 11y agohttps://en.wiktionary.org/wiki/if_all_you_have_is_a_hammer,_everything_looks_like_a_nail https://en.wiktionary.org/wiki/if_all_you_have_is_a_hammer,_...
- vinceguidry 11y agoAll I'm getting paid to do is drive nails. If I want to scratch an itch, I'll start a side project. Then again, I use Ruby because I love it, so my side projects tend to also use Ruby. Also, programming languages are not tools. The tools are the programs written in the language. The language is just the human interface layer. Why people get emotional about this I have no idea. (three downvotes in 1 minute on GP) With a programming language, you custom-build a tool for every nail-like object you have to drive into wood-like material.
- jeena 11y ago> All I'm getting paid to do is drive nails. Because you only have a hammer, what do you expect? > Also, programming languages are not tools That is obviously not true. If I want to write a decision engine then Prolog is a good tool for that, if I want to write a high volume web-api then Go or Erlang is a good tool for that, if I want to write a kernel module then C is a good tool for that. And so on. Saying that all objects are nail-like and all materials are wood-like is, at least in my world, quite crazy.
- jfoster 11y agoIf Heroku is amazing but too expensive, what about Google App Engine? As an under-utilised Google service there is the risk of it being shut down, but aside from that, it delivers on the PaaS promise quite well. The free tier is generous and works on a per-app basis.
- aikah 11y ago> The free tier is generous and works on a per-app basi The RDBMS isn't part of the free tier AFAIK. The free tier has an horrible datastore and some weird limitations. You can't even do external http requests with your own libs you have to use some stuff provided by Google, and it rewrites incoming request headers. Nobody is using AppEngine because it is not a good service, even for free. I'm not talking about the latest "google cloud" PaaS which is a very different service.
- stickfigure 11y agoIf you're just looking for a cheap platform for personal projects, why not Google App Engine? You can spin up a dozen free low-traffic projects without trouble, and if you have at least one Real project getting billed you can get more. Hell, you can even use PHP. However, ultimately, you get what you pay for. Sure, you can get a cheap VPS that you manage yourself, and will die when the hardware it's on craps out. Or you can go with a managed service that handles failover, replication, backups, etc for you. Somebody ultimately has to get paid for all that work. It's amazing that Heroku, GAE, et all are as cheap as they are. Self-hosting is cheap only if you do not value your time.
- hyperpape 11y agoOr if your traffic grows: https://twitter.com/pinboard/status/687498864849375233 https://twitter.com/pinboard/status/687498864849375233
- staticelf 11y agoMostly because GAE disables me to choose any stack I want. I need to use specific frameworks/tools to use their SQL variant AFAIK.
- tracker1 11y agoGAE supports several options... and the SQL interface uses MySQL's API.
- sigsergv 11y agoGoogle App Engine is extremely unstable, I have a few 5-year old bugs that are still not fixed. And these bugs are really critical like not functioning backup/restore. And I'm not a fat enterprise customer so there are no chances they will be fixed.
- bobby_9x 11y agoFor web projects, I still use PHP+Codeigniter. There still aren't good, mature, battle tested frameworks in any other language. If I could, I would gladly replace my code base with Python. Edit: It's pretty telling about the HN community when I simply post an honest opinion about my coding practices, and I am down voted into oblivion. How are we ever going to actually progress when we can't even talk about things openly and honestly without getting the equivalent of shouted down. Your feelings may be hurt, but I'm still not going to use Django until it improves.
- kyllo 11y agoHow is Django not good, mature, and battle-tested?
- arien 11y agoI'm a PHP advocate, although I've found Django easy to get up and running for personal web projects. I mostly enjoyed the out of the box admin panel :)
- leesalminen 11y agoI still use PHP+CodeIgniter as well, but to be fair, there are other mature frameworks out there. Django is one.
- ogsharkman 11y agoI'm not against PHP but that statement is flat out wrong. To me it seems a lot of PHP frameworks are building on the frameworks that came before them in other languages like Rails, Django, et al which is a good thing.
- xyzzy4 11y ago> The problem with Heroku is their pricing model and while $7 doesn't look like a lot it rockets when you have several projects. Just having 10 applications make the cost go up to $70 which is already too much to put down each month for something that might as well not pan out to anything. Couldn't you have one Heroku app instance that runs multiple PHP apps?
- staticelf 11y agoThis made me curious, how would you setup that if you want different domains for each php app? From all I know, you need to pay $7 per app.
- xyzzy4 11y agoYou could buy multiple domain names through Godaddy or such and just set them to forward with masking to various URLs of your heroku app. I don't see why this wouldn't work.
- ef4 11y agoIf you program for a living and you worry about hosting costs for small projects, you are misjudging your opportunity cost. You are valuing yourself way too low. You're going to pour $5000 or $10000 worth of your time into a project, but then balk at spending $100 to host it long enough to see if it grows. Makes no sense. And if you are cash poor, you're much better off spending some of that project time getting paid, and you'll soon be able to afford as much hosting as you want.
- staticelf 11y agoThis is kind of the point I am trying to make. Laravel Forge is selling me that time I would spend on configuration for a fraction of the price of other services. But yes, I agree with you, kind of. But my websites are never probably going to have a lot of visitors. I want to build up a network of sites that all give me a small amount of income. Perhaps in the future it will give me more income and then I could spend it more wisely.
- Zyst 11y agoThe point I understood from your article makes is that the few dollars you are saving over having another language stack (Java/Python/etc) makes using PHP over them worth it. Which, as people here mentioned, shouldn't really be your main consideration. If you wanna keep programming in PHP that's perfectly fine, but all in all the minor price difference between stack hosting prices is a poor excuse to justify it.
- staticelf 11y agoYes, that is correct. Yes of course, I agree that it shouldn't be my main consideration. I will think about it, since I really want to switch programming language.
- brightball 11y agoIt also depends on the situation. He's said that he's looking for several small sites to provide extra income meaning that he's looking at it from a cash-flow perspective. From a cash flow perspective, hosting cost definitely is a factor. This is the specific type of situation that PHP is almost ideal for because it scales down better than most other languages since everything is loaded and processed on-request instead of booting up to preload. You can host 1,000 PHP sites on a single small server as long as the concurrent traffic doesn't outstrip the specs. With most other languages that have to boot and preload, you're restricted before traffic becomes a consideration. PHP's not the right choice for every situation but for his use case it's pretty solid.
- ck2 11y agoHHVM and PHP7 change everything about php, the performance is incredible now. You can use a $20 per YEAR vps and get really decent performance with nginx + php7
- Zyst 11y agoHijacking a bit of the thread. Does anyone know of a price sensitive ASP.NET setup? I would love to use ASP.NET for hobby projects, but it really is quite prohibitive price-wise compared to almost every other web setup. Hopefully prices will go down with ASP.NET 5 being able to run on OS X and Linux, but as of right now I haven't really found any cheap alternatives to Azure to run ASP.NET on.
- reboog711 11y agoPrice sensitivity is open to interpretation. I have a Windows VPS from AccuwebHosting https://www.accuwebhosting.com/vps-hosting/windows-vps-hosting/vps-classic https://www.accuwebhosting.com/vps-hosting/windows-vps-hosti... Less than $10 a month on their lower priced plans; although over the years I have beefed up my machine. I use it for ColdFusion apps/sites primarily, however there is no reason why .NET wouldn't work.
- Zyst 11y agoThanks, I'll check it out. Pricing looks good.
- romanovcode 11y agoYou can just use cheapest DO droplet and run it under mono. That's what I do for the last year.
- drinchev 11y agoSo the OP says hosting is expensive and in the same time pays for provisioning service + the hosting service. That's sad. I wrote my `git deploy` server-provisioning script with ansible [1] for a weekend. Using DigitalOcean's API you can make a deployable server in your bootstrapping phase ( like running yo [2] ). I'm using this script since an year and so far it saved me 120$, I guess. What I don't have here is support for scaling, but anyway I hope one day I would need to scale my hobby-project to a point that I can see the difference between 1 and 4 VPS. Also keep in mind that PHP is a bit slower than the alternatives these days - NodeJS, Go ... Hmm... [1] https://www.ansible.com/ https://www.ansible.com/ [2] http://yeoman.io/generators/ http://yeoman.io/generators/
- tracker1 11y agoDokku or dokku alt on digital ocean... A $40 VPS can handle quite a bit of load... there's not much in terms of scaling, or redundancy, but as a starting point, with similar cognitive overhead, it's a nice starting point and value... Once you need more, you can worry about it when you need it. (posted same comment on-site)
- sharemywin 11y agoI think you should actually put a number with your time and do the math. It's all guessing though.