PHP Programming
Bring back old photos
share again, live again enjoy again.
I have about 30 years of photos sitting on a hard drive. Weddings, road trips, concerts, random Tuesday nights that somehow became important memories. They were a mess — duplicates everywhere, iPhoto libraries inside iPhoto libraries, GoPro footage mixed in with birthday photos from 2003. I needed to sort them. I did not want to pay Adobe or Google or anyone else a monthly fee to do it.
So I built something.
This is the story of how a single PHP flag I had never used in 30 years of web development turned into a full photo management suite running entirely on my Mac — no subscription, no cloud upload, no third-party app. Just PHP, MySQL, a browser, and a little help from Claude.
The Problem
The drive in question is called sethstudio1. It has year folders going back to 2002. Inside those year folders is chaos — Live Photo MOV clips paired with their HEICs, JPG duplicates of photos that already existed as HEICs, macOS junk like .DS_Store and __MACOSX folders scattered everywhere, sidecar files from every version of iPhoto and Photos that ever touched the drive.
Before I could sort anything I needed to clean. The first thing we built was a PHP command-line script that recursively walked the entire drive and removed:
- Metadata and sidecar files (.aae, .xmp, .thm, .json)
- macOS junk (.DS_Store, __MACOSX folders, Thumbs.db)
- Live Photo MOV clips where a matching HEIC or JPG existed
- JPG duplicates where a HEIC twin existed in the same folder
- Exact duplicates detected by filename and file size
- Empty directories left behind after cleanup
Those 8,147 duplicates were the big one — the result of backing up iPhoto libraries on top of each other for two decades without ever cleaning up.
The PHP Thing Nobody Talks About
I have been writing PHP since 1996. I have built thousands of WordPress sites, custom CRMs, billing systems, employee dashboards. I know PHP.
I did not know about this:
One flag. That is it. PHP has had a built-in web server since version 5.4 — released in 2012 — and I had never used it. Pass a script filename after the address and every request routes through that file first, giving you a fully functional HTTP server with zero Apache configuration, zero nginx, zero WAMP virtual host setup.
So that became the architecture. A single PHP file — photo_review_api.php — that serves as both the web server and the API. Visit / in a browser and it serves the HTML interface. Send a POST request with {"action":"scan"} and it recursively indexes your photo drive into MySQL. Send {"action":"move"} and it physically moves files on disk and updates the database. Everything stays on your machine.
What the Reviewer Does
The photo reviewer is a dark-mode web app that runs in your browser, connected to the local PHP server. From the grid view you can:
👤 People tagging
📁 Category assignment
🔒 Private categories
🎨 Open in Photoshop
✉️ Email as attachment
📋 Copy to clipboard
🌐 Push to WordPress site
⤢ Fullscreen lightbox
🗑 Batch delete
The category system knows the difference between people and places. Check one person — photo moves to their folder. Check two or more people — photo goes to a friends folder automatically. The individual people are still saved as tags in the database so you can filter by person later. Private categories are hidden by default and require toggling a switch to reveal — safe to use if a client is watching over your shoulder.
The workflow defaults to showing only unsorted photos. As you assign categories, photos disappear from the grid and the next one auto-selects. You can move through hundreds of photos fast.
Personal and Business Workspaces
About halfway through building the personal reviewer it became obvious the same tool could handle client work. SolarBlu does web design and hosting for small businesses across Illinois — and clients often have the same problem. Photos scattered across drives, no organization, no system.
So we added a workspace switcher:
- Personal Scans the sethstudio1 drive, people and places categories, private protection, full personal workflow
- Business Scans the Solarblu_Projects folder, client folders as categories, moves files into a proper clients/[clientname]/ structure
Add a new client with one click and their folder is created automatically. The whole interface tints amber in business mode so you always know which workspace you are in. Both share the same MySQL database but keep their data completely separate.
The Shell Command Trick
Because the PHP server runs locally on the Mac it has full access to shell commands. So we added a shell_open API action that fires native Mac commands when you click a button in the browser:
- Photoshop — open -a "Adobe Photoshop 2026" /path/to/file
- Finder — open -R /path/to/file reveals the file in its folder
- Mail — AppleScript composes a new message with the photo already attached
- WordPress — copies the file directly into any of your sites' uploads folders
This only works because everything is local. A hosted web app could never do this. The browser talks to a local PHP server that has shell access to the same Mac — that is the whole trick.
What Is Next
- Quick-move overlay — click people's names directly on the photo without touching the sidebar
- Screenshots folder integration — hook the Mac screenshots directory into the reviewer
- External drive support — plug in a client's drive, pick it from a dropdown, sort their photos into the right client folder
- Slideshow — sorted photos feed into a fullscreen slideshow that AirPlays to Apple TV
- More tools on the launcher — CRM dashboard, billing tool, content scheduler, all on their own ports
If you are a small business owner drowning in unorganized photos — client headshots, product shots, event archives — this is something SolarBlu can build for you as a custom local tool tailored to your workflow.