The job: a 15-year-old app on an 8-year-old server
A field-service company came to us with a problem a lot of established businesses have and few talk about. Their whole operation runs on a custom web app someone built for them around 2011: dispatchers create jobs, assign technicians, text them the details, close the job out and run commission reports. It works. Staff know it by heart. Nobody had touched the code in years.
The server under it was a different story. It ran Ubuntu 16.04 and PHP 7.0, both out of support for years, with 173 pending updates, 128 of them security fixes. When the October 2026 PHP2Shell vulnerabilities landed, PHP 7.0 was on the list of versions that would never get a patch. The ask was simple: move the app to current, supported software without breaking anything the office relies on.
We did that in two days of focused work. Along the way we logged more than 40 problems, most of them security holes that had been sitting in the code for a decade. Here is what we found, what we changed, and what any business running an older custom app should check.
The rule: the office shouldn't notice
An upgrade like this fails in one of two ways. Either it breaks something the staff use every day, or it "modernizes" so much that nobody can find anything. So we set one rule before writing a line of code: every page, report and export has to come out exactly the same as before, unless we're fixing a bug on purpose.
We worked only on a copy, on our own machine, with the live server left untouched. Then we proved "the same" with numbers instead of eyeballing it:
- We ran the original code side by side with the new code on the same data, sent both the same form posts, and compared the results.
- The Excel export matched the original in every cell, total, column width, font and border.
- All 2,917 saved technician report links, and 1,728 filter combinations, returned identical results.
- After testing, every database table's row count and checksum matched the original, so no real data changed.
- PHP warnings on a full walk-through of the app dropped from 7,524 to 2, with every page's output unchanged.
What we upgraded
Every component moved to the current stable release, installed from official sources and checked against known vulnerabilities (zero found):
| Component | Before | After |
|---|---|---|
| Operating system | Ubuntu 16.04 | Ubuntu 26.04 LTS |
| PHP | 7.0 | 8.5 (security support through 2029) |
| Database | MariaDB 10.0 | MariaDB 12.3 LTS |
| Texting service | Node.js 16 | Node.js 26 LTS |
| Excel library | PHPExcel (abandoned) | PhpSpreadsheet 5 |
| Connection | Plain HTTP | HTTPS with a free certificate |
We stayed on PHP 8.5 rather than the 8.6 release that came out days earlier. A brand-new major version can wait for the first round of fixes; 8.5 is fully supported for years.
What we found under the hood
Moving old code to a new PHP version means reading all of it. That is where the real value of a job like this shows up. The findings fell into five groups.
Pages that skipped the login
Several pages did serious work with no login check at all. One report export page would run any database command typed into its form. Two public ZIP-code lookups let a visitor read any table in the database. One texting page let anyone send a text to any number from the company's business line, and another showed any technician's message history and phone number. A shortcut in the login code also skipped the check entirely when a web address contained certain text.
Secrets in public files
Old projects leave things behind. We found a full archive of the website from 2019 sitting in the public web folder, with live texting-provider credentials inside. Payment gateway keys were readable as plain text. The latest Excel export, with customer addresses and amounts, was saved where anyone with the address could download it. Library, test and documentation folders were open to the web, along with dozens of old copies of pages that showed their database queries. We confirmed the worst of these on the live site with read-only, header-only checks: nothing downloaded, nothing changed.
Passwords and roles
Passwords were stored in plain text, the login query could be tricked into letting someone in without a password, and the admin page displayed each user's current password. The menu hid admin pages from dispatchers, but nothing on the server stopped a dispatcher from typing the address, editing any account, or promoting themselves to admin. Disabled users stayed logged in for hours.
The classic web holes
Sixteen logged-in pages built database queries straight from typed input (SQL injection). A script typed into a form field would run on 20 of 26 pages (cross-site scripting). Nothing stopped another website from triggering actions in a logged-in user's browser (CSRF). Technician report links were made from the second the report was created, so they could be guessed, and expired reports still sent their full contents.
Data the app had been quietly losing
The office works in two languages. Since a server move in 2019, the database had been saving every non-English character as a question mark, in job notes and in text history. Nobody had connected the dots. Staff had likely just stopped typing in their second language.
What we fixed
- Every page checks the login and the user's role on the server. We tested 4 roles across 21 pages and 20 actions with zero failures, and the last active admin can't be deleted or demoted.
- Passwords are hashed. Existing passwords keep working and upgrade themselves at the next login, so nobody got locked out on day one.
- Every query uses prepared statements. 364 attack requests failed with nothing changed, and normal input saves the same rows as before.
- Everything printed on a page is escaped, and every logged-in action needs a per-session token. 104 forged requests were refused.
- Report links are random 32-character codes, expired reports show nothing, and report pages are rate-limited.
- Secrets moved out of the code into a protected settings file, and the credentials that were exposed get replaced at the switch.
- The web server runs only the app's 32 real entry points. Everything else is refused, so a forgotten backup or test file can never be exposed again. We removed 4,344 unused files, including the old archive.
- Sessions renew at login and expire after idle time, repeated wrong passwords slow down instead of locking people out, and standard security headers are on every page.
- Texting is locked down. The texting service only listens to the server itself, and it checks that incoming messages really come from the texting provider.
Fixes nobody asked for
A careful read of old code turns up bugs that have nothing to do with security. We fixed the ones that were clearly mistakes and asked about the rest.
- The second language came back. We converted the whole database to full Unicode after checking all 1.3 million stored text values. Exactly 875 changed on purpose, including 400 old text messages that now display correctly for the first time in years. New text and emoji save everywhere.
- Apostrophes work. A job note with a quote mark in it used to fail silently. Now it saves.
- Search works from any page of the job list, not just the first one.
- It works on a phone. A light visual refresh took color contrast failures from 61 to 0 and made the app usable on phones and tablets, with every button still in the same place on desktop.
- Reports have a backup channel. If emailing a technician their report fails, the link goes out by text instead.
Some things we deliberately left alone and wrote down instead, like a report date filter that excludes the end date. It has always worked that way, and changing how a commission report adds up is the owner's call, not ours.
The deadline hiding in the email settings
The app sends its report emails through Microsoft 365 with a plain username and password. Microsoft is turning that sign-in method off by default at the end of December 2026, and nobody at the company had admin access to the account to turn it back on. Without a change, the report emails would most likely stop in early January.
We rebuilt email sending around one sender with off, test and live modes, so switching to a dedicated sending service is a settings change. We also found the domain's email security records were incomplete (no DKIM, no DMARC), which makes mail more likely to land in spam, and planned those fixes for the switch.
How the switch happens
The new server is built, hardened and tested: key-only access, a firewall that allows only web and admin traffic, HTTPS, nightly database backups that we test-restored, and a reboot test. Texting and email run in test mode, where messages go only to us, until the final checks pass.
At the switch, the domain moves to the new server, the exposed credentials are replaced, and the two old servers and a pile of 2024 snapshots are shut down, which saves about $31 a month on hosting. The only things the staff do differently afterward: type their password once, and pick a new one.
Is your business running something like this?
Custom apps age quietly. They keep working, so nobody looks inside. A few signs it's time for a look:
- Nobody remembers who built it, or the developer is gone.
- It runs on PHP 7 or older, or a server nobody has updated in years.
- The address starts with http:// instead of https://.
- Staff share logins, or "forgot password" has never worked.
- There are features everyone has learned to work around.
Upgrading doesn't have to mean rebuilding. The cheapest path is often what we did here: keep the app your team already knows, move it to supported software, and close the holes on the way.
Quick answers
Do I have to rebuild an old PHP app to get it onto PHP 8?
Usually not. Most of the work is fixing code PHP 8 no longer accepts and testing that every page behaves the same. In this project the staff kept the same pages, buttons and reports, on fully supported software.
How long does a PHP and server upgrade take?
It depends on the size of the app. This one, about 30 pages plus a texting service and reports, took two days of focused work to upgrade, secure and test, with the switch to the new server scheduled separately.
Will my staff have to learn a new system?
Not if the upgrade is done carefully. We compared the new version against the original on the same data, so pages, reports and exports came out the same. The visible changes were a cleaner look, a phone-friendly layout and one new password.
Is it safe to keep running PHP 7?
No. PHP 7 has been out of support for years and gets no fixes for new vulnerabilities, including the October 2026 PHP2Shell bugs. Upgrade it, isolate it, or replace it.
Got an old app nobody wants to touch?
Tell us what it runs on and what it does. We'll tell you what an upgrade involves and quote it flat before any work starts. If you're not sure what's under the hood, we'll check that for free first.



