10+ Best Free and Open Source PHP Image Gallery Scripts

  1. Coppermine
    Coppermine is a multi-purpose fully-featured and integrated web picture gallery script written in PHP using GD or ImageMagick as image library with a MySQL backend. Coppermine is free software which you can download and install on your webspace.

    Coppermine
    Coppermine

    Some special features:

    • arrangement of pictures in categories and albums;
    • picture information stored in database;
    • users can upload pictures with web interface or ftp (and admin can batch-add to database);
    • full multimedia support
      creation of thumbnails and intermediate size pics;
    • search feature; last added;
    • random picture;
    • user management (private galleries, groups);
    • integration of user management with various bbs (like phpBB, YaBB SE, SMF, Invisionboard, vbulletin);
    • caption, title, description and user defined fields for each picture (searchable);
    • easy install (installer provided);
    • multilingual;
    • user comments;
    • e-card feature;
    • slideshow viewer;
    • all features customizable with web interface (admin section);
    • template system;
    • user membership in multiple groups;
    • upload approval notice for admin;
    • EXIF/IPTC support;
    • language selection option in template;
    • image rotation; multi-pic upload; and many more
  2. GALLERY- Your Photos on Your Website
    Gallery is an open source web based photo album organizer. Gallery gives you an intuitive way to blend photo management seamlessly into your own website whether you’re running a small personal site or a large community site. Serving millions worldwide, the Gallery project is the most widely used system of its kind.

    Gallery
    Gallery

    Features:

    • In place editing of images and metadata
    • Store metadata in files
    • Add multiple users to groups
    • Improved contextual help display
    • Administration dashboard
    • Album display modes (thumbnails, lists, slideshow)
    • Drag and drop images
    • Drag and drop watermark placement
    • Image area annotation
    • Image zoom
    • Batch edit
    • Simple blogging
    • Set metadata fields as required/optional
    • Editable feature labels
  3. TinyWebGallery
    The TinyWebGallery is a free php photo album / gallery that is very easy to install, extremely user friendly, does not need a database (uses xml files) but still has all the features you should expect and much more.

    TinyWebGallery
    TinyWebGallery

    Besides the features you find in most other galleries TWG has e.g.

    • AJAX + Flash navigation with sliding image thumbnails
    • XML based – no database needed
    • TWG Admin to upload/manage images, manage
      users, Color Manager, Configuration of TWG …
    • Keyboard navigation (arrow keys)
    • 3 different slideshow types
    • Protected galleries
    • Text and image watermarks
    • Full video support
    • TWG Flash uploader
    • Frontend in 29, backend in 5 languages!
    • Fullscreen mode
    • Remote picture support
    • All features can be enabled/disabled/configured
    • And a lot of things that makes this photo gallery unique.
  4. Piwigo – Your own photo gallery
    Piwigo is photo gallery software for the web, built by an active community of users and developers. It is written in PHP and requires a MySQL database. Extensions make Piwigo easily customizable. Piwigo offers a wide set of features for any photo gallery. Icing on the cake, Piwigo is free and opensource.

    Piwigo
    Piwigo

    Features:

    • Add Photos : with a web form, with an FTP client software, with digiKam, Shotwell, Lightroom, iPhoto (Mac users), Aperture (Mac users) or mobile applications for iPhone/iPad and Android
    • Multiple size : each photo is availabe in 9 sizes, from XXS to XXL, for improved compatibility with various screen resolutions (from smartphones to HDTVs)
    • Watermark : Piwigo can automatically add a watermark on all photos, to protect photos against unwanted copy.
    • Albums : Each image is bound to one or more albums. Albums are hierarchical and there is no limit in depth.
    • Tags : An administrator describes photos with tags, then visitors can browse photos by tags or multiple related tags, for example “night + Paris + John”.
    • Calendar :Extracted from EXIF metadata, Piwigo knows the date of each photo and is able to display photos for a given day, month or year.
    • Themes : The appearance of the photo gallery is defined by the theme. There are various themes provided by the project community.
    • Plugins : Plugins expand capabilities of Piwigo. Example of plugins: YouTube, Vimeo, Dailymotion, Google Maps or displaying photos in a Lightbox.
    • Access control : Access control is handled by the user manager, restricting and granting varying levels of access to photos and albums.
    • Notification system : Users can be alerted of changes and updates through RSS feeds, E-mail or sharing on social networks Twitter, Facebook or Google+.
  5. Pixelpost
    Pixelpost is an open-source, standards-compliant, multi-lingual, fully extensible photoblog application for the web. Anyone who has web-space that meets the requirements can download and use Pixelpost for free. Pixelpost can run on just about any web server in the world. It requires PHP ( GD library ) and MySQL. There is a great range of templates and addons available to extend the basic features already included.

    Pixelpost
    Pixelpost

    Features:

    • Smooth Install Assistant : Users who are upgrading will appreciate the new super-smooth upgrade system as well.
    • Fancy Admin Stuff : Lots of little tweaks that are sure to make your life better.
    • New Tags for Image and Browse Page : New features that will make the template system even easier to use.
    • New Defensio Addon : A brand new spam filtering web service which comes as Pixelpost default addon now, it can be used instead of Akismet.
    • Cool Feed Options : Setup your feeds to fit your needs.
    • New Languages : For our friends all over the world!
    • Brand New Front Workspaces : Addon creators are going to love us for this.
  6. zenPHOTO
    Zenphoto is an answer to lots of calls for an online gallery solution that just makes sense. After years of bloated software that does everything and your dishes, zenphoto just shows your photos, simply. It’s got all the functionality and features you need, and nothing you don’t.

    ZenPhoto
    ZenPhoto

    Features:

    • Upload via backend
    • Multiple upload
    • Slideshow
    • Comments
    • Front end editing
    • Watermark
    • Password protection
    • CMS Management
    • Several media formats; Image, Audio, Video and Other filetypes
    • Multi-lingual
    • Theming/Templates
    • SEO friendly
    • Gallery Statistics
    • Search
  7. phpAlbum
    phpAlbum.net is an Open Source PHP script which allows you to create your personal Photo Album / Gallery in just a seconds. All you need is a web space hosting with FTP access. No database is needed. After a few clicks with our phpAlubm.net Installer you are ready to upload your photos, create new directories /galleries, and use your photo album.

    phpAlbum
    phpAlbum

    Features:

    • Automatic generation of thumbnails and resized
    • Commenting of pictures with antispam security code
    • E-Card – you can send e-cards to your friends and family
    • Screenshots for files to be downloaded, movie, audio, exe or whatever
    • Password protection for your private galleries
    • Admin section for creating new directories, uploading photos,Uploading ZIP Files preserving directory structure.
    • Short and long description of galleries/directories and photos
    • Highly customizable layout, separated layout(HTML) from functional code, this allows easy creation of new themes
    • Caching of all generated thumbnails and resized photos
    • Transparent logo and icon processing with any background color, including IE6
    • Access logging, with exclude strings
  8. Shutter – photo gallery software
    Shutter allows you to store and share your photos in an unlimited number of albums with ease of control. Shutter is free to download. It requires PHP (with GD support) and MySQL. Shutter comes with many additional features including album slideshow, multiple photo upload, progress bar when uploading, automatically export EXIF information on upload and click-and-drag photos and albums into a new order.

    Shutter
    Shutter

    Features:

    • Simple Web Based Installation : Once the files have been upload with the correct permissions, the installation is easily managed online.
    • Web Based Configuration : Edit several settings including the name of your website and whether you would like search engines to index your website.
    • Unlimited Photo Albums : Create as many photo albums as you wish.
    • RSS Feeds : LIve RSS feeds for all photo albums and tags.
    • Upload Multiple Photos : Upload several photos at a time to an album with “progress” bar.
    • Automatic EXIF Import : All available EXIF information is exported from the photo and shared.
    • Album Cover : Select one of your photos to be the cover of the album.
    • Drag ‘n’ Drop Photos and Albums : Simply click and drag photos and albums to re-order their position.
    • Photo Tags : Group photo’s with specific words to create custom sets of photos.
    • Slideshow : Automatically play through all photo’s in an album (includes play/pause, next/previous links).
    • Guest Comments : Visitors can leave comments on your photos. These must be authorised before being published.
  9. PLOGGER – open source web photo gallery
    Plogger is the next generation in open-source photo gallery systems. A web application not bloated with superfluous features or complicated configuration settings. Plogger is a simple yet powerful tool everything you need to share your images with the world. Plogger is your photos integrated into your website, a fully featured photo sharing package with an attractive and easy to use administrative interface that makes managing your galleries a breeze.

    Plogger
    Plogger

    Features:

    • Easy Install and Setup
    • Easy Gallery Creation
    • Build your Own Themes
    • Plogger XML Service
    • Better International Support
    • AJAX inline-editing
    • Include from Anywhere
    • Upload Zip Files
    • Liquid Galleries
    • Automatic Thumbnail Generation
    • EXIF auto-extract
    • XHTML W3C Compliant
    • Mass Downloading
    • User Feedback
    • Cruft Free URL’s
    • File System Based Organization
    • Selectable Thumbnails
    • Improved Importing
    • RSS support
    • Remote Access
    • Integrated JavaScript Slideshow
    • International Character Code Support
  10. PHP Photo Gallery
    PHP Photo Gallery is a free script for your photo album. It requires PHP with GD support and MySQL. This is simple yet very useful photo gallery script you can find. It is loaded with lots of features you may want in gallery.

    PHP Photo Gallery
    PHP Photo Gallery

    Features:

    • Unlimited albums, subalbums and photos
    • Picture comments and ratings
    • Multi-image uploader
    • Online photo editor (rotate, crop, darken, lighten, blur, emboss)
    • EXIF/IPTC extraction (optional)
    • Watermarking with image or text(optional)
    • Integrated SEO module (for good search engine rankings)
    • Integrated Javascript slideshow module
    • Caching of all generated thumbnails and resized pictures (browser and server side)
    • Hotlinking prevention (optional)
    • Template driven(code is separated from design)
    • Automatic generation of thumbnails and intermediate photos (sizes setable via admin)
    • AJAX flash uploader
    • Multi-file uploader
    • Show latest, favorite, top and random photos
    • RSS/XML feeds(optional)
    • Integrated search engine (user and admin)
    • Meta and gallery description (optional)
    • Easily move and/or edit albums, photos
    • Set albums and/or subslbums per row
    • Set photos per page
    • Order photos/albums by date added, date shot, weight number, alphabetically
    • Set latest/favorite/top photos per page
    • Statistics (number of photos, photo/album views)
    • Encrypted database passwords
    • AJAX powered control panel
    • Sql injection and xss built-in protection
    • Visual Confirmation to prevent spamming(optional)
    • Contact us page with optional visual confirmation(captcha)
    • Simple and easy admin management
    • Compatible with Internet Explorer, Safari, Firefox, Opera
    • Active support forum
    • Compatible with PHP 5 and PHP 4, MySQL 4 and MySQL 5
    • Easy installation
  11. 4images – Image Gallery Management System
    4images is as a web based PHP and MySQL for displaying images on the Internet. 4images can be configured through an administration area. 4images supports apart from the typical image formats like JPG, GIF and PNG, other data formats. Furthermore 4images includes a template system to modify the design of the gallery. An external language file allows for easy translation into other languages.

    4images Gallery
    4images gallery

    Features:

    • manage images and videos
    • upload through browser, through admin panel or via FTP (Batchupload)
    • automatic thumbnail generation
    • automatic image resizing
    • showing IPTC and EXIF data of images
    • protection against hotlinking
    • extensive, password protected adminstration are to configure and control the whole gallery system
    • database backup function
    • multi language support
    • unlimited categories and subcategories
    • comment system
    • extensive permission management for users and usergroups
    • upload function for registered users
    • easy to customizable layout via templates to fit the own web layout
    • easy to customize e-cards (colors, font)

PHP function to remove array element based on array key

Here is a small and simple PHP function to remove one or more than one array elements based on the keys of the array. You need to pass the original array along with the keys. Keys may be only one as a string or it may the array of keys. Resulting array would be the filtered array and preserved with array keys. If the given key is not found original array will be returned.

Here is the PHP code.

Example 1

Output :

Example 2

Output :

How to parse hashtag, mention and URL in a tweet

How to parse hashtag, mention and URL in a twit

I was trying to make a simple twitter application. Using jQuery and AJAX, grabbing twits was not that hard. But twitter returns twit in just simple characters. I needed to show the correct link for the mentions and hashtags and also needed to parse the URLs. So, after little search I came up with some Regex to grab it and then I made a simple function to parse twit. I needed such function in javascript as well as PHP. I just want to share that function here.

DEMO

Simple regular expressions are used here. But you can use more robust and advanced regular expressions also.
For URL

For Mention

For Hashtag

Same output can also be obtained from PHP in server side.

PHP function preg_match_all matches the regular expression globally and it is similar to /g modifier. All the matches and to be replaced values are saved in the array. After parsing all, those findings are replaced at once by str_replace function.
Img src : hughlashbrooke

New Built-in web server in PHP 5.4

Out of several awesome features of new PHP 5.4, built-in web server is most impressive. It runs from command line and it can be used in any OS like Windows, Mac or Linux. PHP manual stresses that it is only for development purpose only, but it has great possibilities for the future. For example, you could distribute portable web applications on CD ROMs or USB sticks, or even as desktop applications, all created with PHP without needing GTK or other graphic libraries.

This web server is designed for developmental purposes only, and should not be used in production.

So, how to use it then. First download the new PHP 5.4 from the PHP’s official site. Extract it in a folder in your hard drive. For example C:php is the folder where our extracted files are kept.
If you are using Windows, then you need to set environment variables to access the executable file from any place. In Windows 7, open Control Panel and click System. Then click Advanced systems settings. There comes a pop up box. Click Environment variables. In the System Variables create new variable with variable name PATH and variable value ;C:php and save it.

To start a web server

This is the simplest and basic command to start the webserver. You have to run this command from root project folder. This will return either index.html or index.php. If neither file exists then 404 response code will be raised.
If you want to start with a specific document root directory then yoiu need to use -t flag followed by the path to the new docroot.

You can also have router script. Here is a sample provided in the PHP manual.

Enter command like this:

Server will display the requests for images but requests for html files will display “Welcome to PHP”.
Having builtin webserver has also one interesting advantage. You can directly download and test the script without any need to reconfigure apache or anything else. If its good then you can use it in the project. Though it is NOT recommended for production sites, we have to agree it is one nice and impressive addition in PHP.