Using a folder in external drive to display on Single PHP Gallery

Hey guys,

I installed Single PHP Gallery from the Software list, but I wanted to know if there´s a way for Single PHP Gallery to display pictures I have in mnt/ext/pictures

Right now all the pictures must be in folders under var/www/gallery/

Thanks in advance as usual.


I guess PHP Gallery is not capable for this. However you could try to create a sym link from inside /var/www/gallery/Folder pointing to /mnt/ext/pictures. But I’m not 100% if this will work

Thanks Joulinar for the suggestion.
You mean then to execute this command? ln -s /mnt/ext/Pictures /var/www/Gallery/Pictures

At least it would be an idea

Thanks again Joulinar, the link didn´t work after all. I was searching on the index.php file and found this config:

define('GALLERY_ROOT', './');

Set the path of the gallery root, where the images and sub directories containing images is placed.

I modified that path to my mnt/ext and seems ot be working, for some reason CPU usage is pretty high, but maybe it´s because it´s generating all the thumbnails.


ah that’s a good alternative :smiley:

Where is this file to modified?

Should be in /var/www/gallery/index.php.

1 Like

It’s works. :slight_smile: Now this is phrase to change:

option('GALLERY_ROOT', './');

Set the path of the gallery root, where the images and sub directories containing images are placed.
The default value is './' which is the directory where the script is placed.

If GALLERY_ROOT is set to an absolute path and SHOW_FILES is set to TRUE, then a symbolic link called "_sfpg_download" will be created in script directory. This link gives web access to the GALLERY_ROOT, enabling download of files.

IMPORTANT: GALLERY_ROOT should always end with a slash like the examples below.

Example 1: './images/'
Example 2: $_SERVER['DOCUMENT_ROOT'].'/gallery/images/'
Example 3: '/users/bob_the_user/wwwroot/images/my_pictures/'

I thing this option could be on dietpi www software option. :slight_smile:

not sure if this is going to work. I just tested the symbolic link without issues.

  1. create the folder on USB drive and copy something in
mkdir /mnt/usb/picture/
  1. create the link to the new folder
ln -s /mnt/usb/picture/ /var/www/gallery/MyPicture
  1. refresh PHP Gallery and I can see the new picture

At least this allows to use multiple folders to integrate located on various locations.

not really, how should we know which folder user like to use :slight_smile:

only information about a option ;). Like about Samba of FTP servers options.

not sure if this is going to work

works for me without issue

More something for our online docs.