: What do shared hosting sites actually mean when they forbid HTML handling server side code? Forbidden in the TOS/AUS of a large number of shared hosting sites is the phrase "Force html to handle
Forbidden in the TOS/AUS of a large number of shared hosting sites is the phrase "Force html to handle server-side code (like php and shtml) to help reduce usage." as a prohibition.
I asked a HostGator tech support guy who supposedly asked someone and came back with "It just means that you can't use HTML to parse PHP to reduce load on the server" which is even more wacky.
I've searched on various combinations of the terms, trying to see if I'd missed some recent new term or technique, but came up short. (Found many tips on setting up apache to serve PHP files as .html) That's how I found the language is used a lot throughout the industry.
Anyone know what this would mean if enforced?
More posts by @Kevin317
3 Comments
Sorted by latest first Latest Oldest Best
Having worked for a hosting company for quite a while I can confirm that leaving the default handler for .html files to be PHP leads to huge overhead on the servers. The reason for this is that there are many users who never bother to change that, they just upload some site and leave it as it is.
With the default handler set to PHP this means that all .html files on the server, no matter if they are actually PHP are going to be served through the PHP parser, which consumes much more memory and CPU cycles.
Being a shared hosting also means that all of the users(which are usually a few hundred per server) share the same resources. If one of them starts to consume more, the others have to consume less. This means that you have to to limit what users can do to make sure everyone is getting relatively good experience. It a compromise which needs to be done, otherwise you are allowing one(or few) user make to everyone else's experience bad(slow speeds, unresponsive pages etc.)
As for why they actually 'Forbid' changing this on the user side(.htaccess), I don't know, probably for similar reasons.
Imagine having a site with 1000 .html files in it and only 2-3 of those have actual PHP code in them. The server will have to parse all those files, even though there is no PHP in them.
Keep in mind that shared hosting is the cheapest solution and there are always some kind of limitations. Prices are so low that everyone is forced to cut any possible corners to keep the business profitable. On the plus side - there are a ton of shared hosting providers, so you can always switch to another one which fits you better.
If you need to do more custom things buy a VPS/dedicated server.
In case my comment above isn't clear, the entire notion of this is absurd. When you configure apache, or set .htaccess, you are simply telling apache what to do with various extensions. The notion that there is any overhead on a php page, for example, with .html extension, is incorrect. And why would you add php processing to pages without php? The extension is just some letters after the dot. You can have a straight html .php page, or a pure php .html page, makes no difference, and if it somehow does to that hoster, that's a very bad hoster, which will almost certainly make you suffer in many ways.
Since this is something you can set in your .htaccess, or in apache configs, you do it, presumably, because you are planning to use php on the pages, which means, there is as far as I know zero difference or overhead increase if the extension is .html over .php, in both cases, apache hands the processing to php, which then does its thing, and returns the processed page html output to apache, more or less.
I too started with low end cheap hosters, wasted untold hundreds of hours of my life, which I will never get back, working with bad cheap hosters, and now won't do it, there's no reason to, all it costs you is time, a lot of it.
If your time is worth more than about an hour, you will never gain anything or save a cent using low end, or middle grade, hosters. And if your time is worth more than 10 bucks an hour, you will never save a cent using anything but high end hosters, shared or otherwise.
And if your time is worth actual professional salary, then you are making a serious mistake. One I've made many times, or rather, allowed clients to make, but now will not do anymore. I find a few fully invoiced low end hoster failure support instances easily convinces anyone that the cost saving was purely an illusion. Or the site going down the first time any site on the box gets any load, whatever.
"Forbidden in the TOS/AUS of a large number of shared hosting sites is the phrase "Force html to handle server-side code (like php and shtml) to help reduce usage." as a prohibition."
I'd like to offer a suggestion: I have NEVER seen this prohibition on any even mediocre hosting company. Never. Not one single time. So I would take that and add it to the list of "how to identify bad hosting companies". Even bad hosting companies have not done that in my experience, so this must be some seriously low end stuff, but I will resist the urge to get into specifics, except to note I'm not surprised to see the name hostgator mentioned in this context.
From what I understand what you mean it's simple:
By default, Apache (or other web servers) will send a .html file to the client as is, without further processing, .php files will be processed by PHP first and .shtml files by the Apache SSI processor. Naturally, this will be more compute-intensive then simply sending out the file as is.
However, it's possible to configure Apache to instead also send .html files through the SSI and/or PHP processors before sending them to the client. If most/all of these files don't contain SSI or PHP instructions, this will create a noticeable and useless overhead, which I believe shared hosters want to avoid.
Of course, this overhead will be less dramatic today then 10 years ago so one might start to argue if this restriction is really still necessary, but since there is no real benefit to parse .html files by PHP (after all, you can just name a file .php), I don't see why this should be allowed.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.