Back to services

Single File PHP Gallery

Web gallery in one single PHP file.

View alternatives to Single File PHP Gallery
Suggest edit
Self-hostable
proprietary
Recent reviews

Alternatives

Tech stack

No tech stack added yet. Sign in to suggest some

Note: The content of the official website, http://sye.dk/sfpg/, could not be retrieved this time. The following is written based on general knowledge of the project, and details that are uncertain have been omitted. Please refer to the official website for authoritative information.

Introduction

Single File PHP Gallery (SFPG for short) is a lightweight web image gallery script. The entire program is a single PHP file. To deploy it, you upload it to the directory where your images are stored, and the images and subfolders in that directory are displayed as an online photo album you can browse.

Key Features

  • Single-file deployment: The program is just one PHP file, with no installer and no complicated dependencies.
  • No database required: It reads the file and directory structure on the server directly, so there is no need to configure a database such as MySQL.
  • Albums organized by folder: Each subdirectory automatically becomes an album, and you can browse through multiple levels of nesting.
  • Automatic thumbnail generation: It uses PHP's image processing capabilities (usually the GD extension) to generate and cache thumbnails automatically.
  • Online viewing of full-size images: Browse a list of thumbnails in the browser, then click one to view the full image.
  • Adjustable configuration: You can edit the settings in the script to adjust its appearance and behavior.

Target Users and Use Cases

It is suited to individual users and webmasters who want the simplest way to share photos on their own website or shared hosting, for example:

  • Showing photography work or travel photos on a personal website
  • Sharing photo folders with family and friends
  • Quickly adding a web browsing interface to an existing image folder
  • Setting up a photo album on cheap shared hosting that only supports PHP

Core Advantages

  • Very simple to deploy: just upload the file and it works.
  • Intuitive management: add or remove images and folders via FTP or a file manager, and the albums change accordingly.
  • Low resource usage, making it suitable for low-spec hosting.

Installation and Deployment

  1. Prepare a web server that supports PHP, and make sure the GD image extension is enabled.
  2. Download the PHP script file from the official website.
  3. Upload the script to the directory where your images are stored (you can also configure the image directory as described in the documentation).
  4. Make sure the script has permission to write to the thumbnail cache.
  5. Visit the script's address in a browser to browse the albums.

Technical Requirements

  • A web server that supports PHP (such as Apache, or Nginx + PHP-FPM)
  • The PHP GD extension, used to generate thumbnails
  • Write permission for the cache directory

Notable Characteristics

This project aims for minimalism and has no upload backend, user system, or similar features. Image management is mainly done by working directly with files on the server. If you need multiple users, online uploads, or advanced album management, consider more full-featured solutions such as Piwigo or Lychee.