FREE & OPEN SOURCE
PHP Scripts
Free Image Hosting PHP Script — Imgur-Style Community
ImgZip: accounts, follows, a Following feed, emoji reactions, GIFs and a built-in meme generator on top of the masonry gallery. MySQL + GD.
What it is
ImgZip is a self-hosted, Imgur-style image sharing community — the biggest build in this series. v2.0 turns the gallery into a small social network: free member accounts (username + password, no e-mail), user profiles with follower counts, following users AND topics (tags), a personalized "Following" feed, and six emoji reactions on every post alongside the classic up/downvotes.
The built-in meme generator is the fun part: pick a template or upload any image, type top/bottom text, and either download the finished meme as PNG (rendered client-side on a canvas — no server round-trip) or post it straight to the feed with one click. GIFs are first-class: animated GIFs upload untouched and get a GIF badge in the masonry feed. Every post also has a Share & embed box with direct link, Markdown, HTML and BBCode snippets.
The admin panel covers the whole community: posts (approve / hide / delete — deletes also remove files from disk), comments, users (delete keeps their posts, unattributed), plus totals for views and disk usage. Under the hood: MySQL/InnoDB with self-creating tables and FK cascades, GD thumbnails, MIME-sniffed uploads, a no-PHP-execution uploads folder, CSRF everywhere, honeypots, and session-deduplicated votes and views. 17 files, no framework, no Composer.
The built-in meme generator is the fun part: pick a template or upload any image, type top/bottom text, and either download the finished meme as PNG (rendered client-side on a canvas — no server round-trip) or post it straight to the feed with one click. GIFs are first-class: animated GIFs upload untouched and get a GIF badge in the masonry feed. Every post also has a Share & embed box with direct link, Markdown, HTML and BBCode snippets.
The admin panel covers the whole community: posts (approve / hide / delete — deletes also remove files from disk), comments, users (delete keeps their posts, unattributed), plus totals for views and disk usage. Under the hood: MySQL/InnoDB with self-creating tables and FK cascades, GD thumbnails, MIME-sniffed uploads, a no-PHP-execution uploads folder, CSRF everywhere, honeypots, and session-deduplicated votes and views. 17 files, no framework, no Composer.
Server requirements & dependencies
- PHP 8.1 or newer with pdo_mysql and gd (both standard on nearly every host, including shared hosting)
- A MySQL 5.7+ or MariaDB database — any cPanel/shared-hosting database works; tables create themselves (the DB user needs the REFERENCES privilege, standard on cPanel)
- Any web server: Apache, Nginx, LiteSpeed, or PHP's built-in server for local use
- Disk space for your images — per-image size cap and per-post image cap are config constants
- No Composer, no Node/build step, no external services or APIs
How to install
1. Create an empty MySQL database (e.g. in cPanel → MySQL Databases) and put its host, name, user and password into the DB_* constants in inc/config.php. All 7 tables create themselves on first load — there is no .sql file to import.
2. Unzip and upload the imgzip/ folder to your server (e.g. yoursite.com/imgzip/).
3. Open index.php?p=login in the browser. On first run it asks you to choose an admin password and prints a ready-made ADMIN_PASSWORD_HASH line — paste it into inc/config.php. Done. Visitors can now register their own accounts from the Sign in page.
Tune inc/config.php to taste: GUEST_UPLOADS (anonymous posting on/off), MODERATION (posts wait for approval), MAX_UPLOAD_MB, MAX_IMAGES_POST, THUMB_W. The uploads/ folder creates itself with an Apache no-PHP-execution rule; on Nginx add the location rule from the README.
2. Unzip and upload the imgzip/ folder to your server (e.g. yoursite.com/imgzip/).
3. Open index.php?p=login in the browser. On first run it asks you to choose an admin password and prints a ready-made ADMIN_PASSWORD_HASH line — paste it into inc/config.php. Done. Visitors can now register their own accounts from the Sign in page.
Tune inc/config.php to taste: GUEST_UPLOADS (anonymous posting on/off), MODERATION (posts wait for approval), MAX_UPLOAD_MB, MAX_IMAGES_POST, THUMB_W. The uploads/ folder creates itself with an Apache no-PHP-execution rule; on Nginx add the location rule from the README.
The prompt — build it yourself
Paste this into Claude and you'll get this product. This is the actual spec that produced the code above.
Paste this prompt into Claude to build this exact product:
What happened when we ran it: Claude produced the full 17-file app — 1,983 lines. Functional tests all passed on the first run: registration + login, member upload, follow/unfollow (with self-follow rejected), tag follows, the Following feed showing exactly the followed content, reaction add/switch/remove arithmetic, member comments auto-attributed, admin user deletion keeping posts (FK SET NULL verified in the database), and the meme generator's canvas pipeline. One genuinely fun debugging story: the meme editor appeared to "double-print" its text — after instrumenting the draw code we found the canvas was fine; the default template (the current top post) was itself a seeded meme that already had a caption baked into the pixels. The fix was excluding meme-tagged posts from the template strip.
Note: the download on this page ships with
Build a complete, production-quality PHP application called ImgZip: a self-hosted, Imgur-style image sharing community with a cleaner, calmer dark design than the original. Structure it as a small multi-file app —index.phpfront controller,inc/(config, helpers, image handling, db, auth, layout) andpages/(feed, post, upload, meme generator, profile, member auth, admin, admin login), one stylesheet, one vanilla JS file. No framework, no Composer.
Data model (MySQL via PDO, utf8mb4, InnoDB, self-creating tables — no .sql import):users(unique username, password_hash, bio, joined),posts(nullable user_id, unique url token, title, comma tags, views, up, down, status live/pending/hidden),images(post_id, stored + thumbnail filenames, mime, dimensions, size, position — albums),comments(post_id, nullable user_id, author, body),follows(follower_id, followed_id),tag_follows(user_id, tag),reactions(post_id, user_id, emoji — one reaction per user per post). Foreign keys with sensible ON DELETE (CASCADE for content, SET NULL so deleting a user keeps their posts unattributed). Single-quoted SQL literals only.
Members: register with just username + password (regex-validated, honeypot, sleep(1) brute-force delay), profile pages with avatar (colored initial derived from the name), bio, post grid, follower/following counts and a follow button. Users can follow other users AND tags; the feed gets an All / Following tab where Following shows posts by followed users or carrying followed tags. Six emoji reactions (👍😂😮❤️🔥💀) per post — one per user, click again to remove, click another to switch — via a JSON fetch endpoint, next to the classic session-based up/downvotes that also work for guests.
Meme generator page: client-side canvas editor — template strip built from the top non-meme posts, or upload your own image; top/bottom text inputs with a size slider; classic white-fill black-stroke meme lettering (measure and shrink the font to fit rather than using fillText's maxWidth); Download PNG entirely client-side; "Post to feed" renders the canvas to a blob and submits it through the normal upload endpoint tagged "memes".
Uploads & GIFs: drag & drop with previews, up to 10 images per post, MIME-sniffed against a JPG/PNG/GIF/WebP whitelist, random hex filenames, GD feed thumbnails (fixed width, JPEG, white backdrop); animated GIFs are stored untouched and get a GIF badge on feed cards. Uploads folder self-creates with a no-PHP-execution .htaccess.
Feed & post pages: masonry columns, Top/Newest sorting, tag filter with a Follow-#tag button, search, 1.2k-style counts, author line with avatar; post page shows reactions bar, tag chips, a Share & embed box (post link, direct image link, Markdown, HTML, BBCode — each with a copy button), comments (members auto-signed, guests with optional name + honeypot) and a "More viral" sidebar.
Admin: password-hash constant with a first-run hash generator; KPI cards (users, posts + pending, images, comments, total views, disk used); moderation tables for posts (approve/hide/delete — delete unlinks image files), comments, and users (deleting keeps their posts).
Demo mode: a DEMO_MODE constant that blocks every write with a friendly message while keeping everything browsable — auto-signed-in as a seeded sample user so the Following feed and reactions are visible. First run seeds ~12 posts by 5 sample users with follows, tag-follows and reactions spread across them, generating its own images with GD: abstract gradient art, meme-format images with top/bottom captions, and a GIF-mime post.Security throughout: CSRF on every form and every fetch endpoint, prepared statements, all output escaped, session_regenerate_id on login, per-session view/vote dedupe. Version the asset URLs (?v=APP_VERSION) so upgrades bust caches.
Deliver all files with their paths. Target PHP 8.1+, strict types in the entry point, MIT license.
What happened when we ran it: Claude produced the full 17-file app — 1,983 lines. Functional tests all passed on the first run: registration + login, member upload, follow/unfollow (with self-follow rejected), tag follows, the Following feed showing exactly the followed content, reaction add/switch/remove arithmetic, member comments auto-attributed, admin user deletion keeping posts (FK SET NULL verified in the database), and the meme generator's canvas pipeline. One genuinely fun debugging story: the meme editor appeared to "double-print" its text — after instrumenting the draw code we found the canvas was fine; the default template (the current top post) was itself a seeded meme that already had a caption baked into the pixels. The fix was excluding meme-tagged posts from the template strip.
Note: the download on this page ships with
DEMO_MODE = false — no demo restrictions. The prompt is for reproducing (or remixing) the build yourself with your own Claude subscription. Reviews
Used Free Image Hosting PHP Script — Imgur-Style Community? A star rating takes two seconds and helps others.
5.0
★★★★★
1 review
5★1
4★0
3★0
2★0
1★0
nactumu
★★★★★
Sep 20, 2026
More builds
Free Chevereto Alternative — Self-Hosted Image Hosting PHP Script (PixelZip)
Free Slingshot Castle Demolition Game — Single HTML File (Castle Breaker 2D)
Free Vampire Survivors-Style Game — Single HTML File (Neon Swarm Survivor)
Free Suika-Style Planet Merge Game — Single HTML File (Cosmic Merge 2D)
License: MIT — free for personal and commercial use, no warranty. Software is provided as is; review the code before running it in production (it's short enough to actually read).