I learned to pin my PHP version the day I found out I did not control it. My downloader site runs on shared hosting, and one morning the host's dashboard showed the PHP version had moved. Nothing had broken, but that was luck, not planning. My resolve script, the one file that talks to every video provider, depends on behaviour that changes between PHP versions. A quiet upgrade could have broken it while I was asleep, and the first to notice would have been a visitor whose download suddenly failed.

That is the risk with shared hosting. You do not own the server, you rent a slice of it, and the host decides when the runtime moves. Most hosts give you a version picker in the control panel, and most people set it once and never look at it again. The default is often "latest" or whatever the host shipped with the account. Both are traps. "Latest" means the next upgrade lands without asking you. An old default means you are sitting on a version the host will retire, and when they do, the change is forced and sudden.

So I pin it. I set the version to a specific release, PHP 8.2, and I treat that choice as part of the site, not as a server detail. The reason for 8.2 is boring and that is the point. It is the version my code was written and tested against. My scripts use typed properties, named arguments, and a few 8.x functions I would miss if I went backwards. Pinning 8.2 means the code and the runtime agree with each other, every day, until I decide otherwise.

Pinning is not the same as forgetting. Every few months I check what has changed in the next version and whether anything I rely on is deprecated. PHP deprecations are usually polite: a function keeps working, the log fills with warnings, and the removal comes a version or two later. A deprecation that becomes a removal is exactly the kind of breakage that arrives on a quiet Tuesday.

The practical steps are small. First, I set the version in the hosting panel to 8.2, then checked the site's health endpoint to confirm it had taken effect. The health endpoint prints the running PHP version, so the check takes seconds and there is no guessing. Second, I wrote the version into my deploy notes, next to the upload checklist, so future me does not have to remember why 8.2 and not something newer. Third, I keep a copy of the whole site, so if an upgrade ever does force my hand, I can test the new version against real code before it goes live.

There is one habit that matters more than the version number itself: I never test an upgrade on the live site. If the host offers a staging copy or a second subdomain, that is where the new version gets tried first. On a plain shared plan, a local copy running the new version does the same job, even a quick Docker container. I run my own test links through resolve.php there, check the provider responses, and only then move the live version. It is slower than clicking a button, but it means I find a broken function in my own test, not in a visitor's failed download.

People ask why I bother, when PHP 8.2 and 8.3 look the same from the outside. The answer is that the outside is not where breakage lives. A changed default here, a removed function there, a stricter warning that becomes an error: each one is small, and any one of them landing on resolve.php takes down every platform at once, because every tool page calls the same script. The version pin is a one-minute job that stops a whole class of surprises.

I run a small video downloader, ramrom.io, on a single shared hosting plan with no build step and no staging server. The discipline is the infrastructure: pin the version, write it down, test before moving, and check the health endpoint after. It is not glamorous work. It is the work that keeps the site up while nobody is watching.