What version of PHP does your gallery run?

155 views
Skip to first unread message

Brad Dutton

unread,
Feb 18, 2020, 2:08:26 AM2/18/20
to Gallery 3 Users
As I make updates to the gallery software I'm always wondering which versions of PHP everyone is running. If I know what minimum version everyone is using I can adjust how much legacy syntax I use. The existing README says to use PHP 5.2 or higher but gallery 3.1 only started supporting PHP 7 last year so I'm assuming most people are still on some variant 5.x. If you don't mind, please make a selection on this quick poll I setup:


Thanks,
Brad

Adrian London

unread,
Feb 18, 2020, 4:20:21 AM2/18/20
to Gallery 3 Users
I upgraded to 7.3 about 4 months ago (with G3.0) and it almost worked ok - just some glitches here and there, but I reverted back to 5.2 (or 5.3 - I forget).  Anyway, as soon as I manually upgraded to G3.1 I upgraded PHP again to 7.3.14 and it's working well.

My hosting provider makes upgrading (or downgrading) php very easy.

The only issue I had after upgrading was working out where the config parameters needed to be.  Instead of php.ini, I had to put them in the horribly-named ".user.ini" file.  Agan, for info, here's my file:

; Local PHP.INI
;
; Used by Gallery.  Overrides the values in ../../php.ini

[PHP]
short_open_tag
= On
magic_quotes_gpc
= Off
magic_quotes_sybase
= Off
magic_quotes_runtime
= Off
register_globals
= Off
upload_max_filesize
= 20M
post_max_size
= 100M

[Session]
session
.auto_start = Off

[suhosin]
suhosin
.session.encrypt = Off


Kazuo k

unread,
Feb 21, 2020, 5:33:54 PM2/21/20
to gallery...@googlegroups.com
Hey Brad,

Just answered the poll.

I do have a small wishlist of features/documentation I'd like to have with further G3.1 updates, and I'm willing to help in any way I can with these:

1. I use NGINX instead of Apache. It works fine but occasionally, especially in the admin area there's strangeness with redirection and 500 errors related to url rewrites. If we can get official instructions/configs for G3.1 on NGINX that'd be swell. I can share my current configs to help out.

2. Native PEAR Mail or PHPMailer/sendgrid integration would be a godsend. Currently emails don't work on mine because we can't use mail(); (due to most carriers now rejecting/silently filtering messages sent without authentication) and the PHPMailer extension is busted to all hell. So we just handle manual resets, but it's definitely a bit of overhead we don't need.

3. PostgreSQL support would be sweet, but not required.

If I can assist with any of this please let me know.

-Kaz Kuroi

Brad Dutton

unread,
Feb 25, 2020, 12:45:09 AM2/25/20
to Gallery 3 Users
> 1. I use NGINX instead of Apache. It works fine but occasionally, especially in the admin area there's strangeness with redirection and 500 errors related to url rewrites. If we can get official instructions/configs for G3.1 on NGINX that'd be swell. I can share my current configs to help out.

I don't use PHP FPM but it should work. From what I can tell there isn't anything in gallery that requires Apache and mod_php to run. If you can check the NGINX and PHP FPM logs when this happens maybe we can figure out what is causing the problem.


> 2. Native PEAR Mail or PHPMailer/sendgrid integration would be a godsend. Currently emails don't work on mine because we can't use mail(); (due to most carriers now rejecting/silently filtering messages sent without authentication) and the PHPMailer extension is busted to all hell. So we just handle manual resets, but it's definitely a bit of overhead we don't need.

This seems like an easy enough request, I'll see what I can do.


> 3. PostgreSQL support would be sweet, but not required.

While I much prefer PostgreSQL over mysql, this isn't happening ;) 

Thanks,
Brad

Brad Dutton

unread,
Mar 1, 2020, 2:29:53 PM3/1/20
to Gallery 3 Users
I added a phpmailer module to replace the built in mail functionality. I didn't replace the base functionality yet because I'm not sure how I want to incorporate the phpmailer dependency. For now here are the directions:
2) update application/config/phpmailer.php
3) in the extracted gallery3 directory where there the file composer.json exists, run 'composer install' to install the phpmailer library
3) enable the phpmailer module in the admin area

I think that should be it. I only tested this with the reset password functionality but the other code that sends email looks identical so it should all work. Let me know how it goes.

Thanks,
Brad

JR

unread,
Mar 1, 2020, 2:48:26 PM3/1/20
to gallery...@googlegroups.com

Brad,

So,  I'm thinking this qualifies as a "beta" version and should not necessarily be used as an normal update unless the G3 user does mailing from inside Gallery 3 (which I is something I never do myself... ).

And just to be clear, what is the directory where composer.json exists? I've never messed with any of the .json stuff.

-- J.R.

--
WHEN USING AN EMAIL PROGRAM to reply to this message, click REPLY TO LIST or REPLY TO ALL so your reply goes out to everyone in the group. If you click REPLY or REPLY TO SENDER Google will *only* send your reply to the original author (not recommended).
 
To post a NEW MESSAGE to the group, send an new email to:
gallery...@googlegroups.com
 
To view or sign in to this group on the web, use this URL:
https://groups.google.com/forum/#!forum/gallery-3-users
---
You received this message because you are subscribed to the Google Groups "Gallery 3 Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gallery-3-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gallery-3-users/112bff04-54ca-46d9-a03b-55cce00c032c%40googlegroups.com.

Brad Dutton

unread,
Mar 1, 2020, 2:51:57 PM3/1/20
to Gallery 3 Users
If you are using the current git version, without a release number, you are always in beta :) If a couple of people test this and it works ok we can release it as 3.1.3.

composer.json is in the top level directory, the same as index.php. You should see it as soon as you extract the zip file.
To unsubscribe from this group and stop receiving emails from it, send an email to gallery...@googlegroups.com.

Gwyneth Llewelyn

unread,
Apr 15, 2020, 1:11:42 PM4/15/20
to Gallery 3 Users
Hi there!

Belatedly replied to the poll, and I'd also subscribe to @Kazuo's suggestion of an 'official' configuration for nginx.

After all, the closest thing we have to an official configuration is this page: http://codex.galleryproject.org/Gallery3:Using_NGINX, which was last updated in 2013 — not only nginx wasn't so popular back then, but configuration files from very old versions seem to be weird (and inefficient!) to me..

Also, see the following discussion: http://galleryproject.org/node/91840 — it started to be promising, but didn't have any new comments after 2010.

So we're basically stuck with old configurations. I'm personally using a tiny variant of https://gist.github.com/cite/6419890 for the past 6 years, but it has its quirks... and the more I try to tweak it, the worse it becomes!

Cheers,

   - Gwyn

Brad Dutton

unread,
Apr 15, 2020, 1:20:34 PM4/15/20
to Gallery 3 Users
I don't know how official it is, but I created a gallery3 docker container that runs nginx and php-fpm:

The nginx config file can be found here:

I did some basic testing with this container but nothing extensive. I'm planning to switch my personal gallery over to this in the future so it gets more testing, I've just been busy with work recently.

Thanks,
Brad

Gwyneth Llewelyn

unread,
Feb 10, 2021, 9:22:37 PMFeb 10
to Gallery 3 Users
I know, I'm bumping an old thread, but I'm so happy to have found a working configuration for nginx + Gallery3 (without Docker) that I'm excited to share it with you folks.


Because the Internet is fickle, and sites come and go (his blog only has two entries from 2015, clearly something he has not been updating...), taking into account that all credits are due to Jon Miller, here is the working configuration:

server {
    server_name <gallery_url>;
    listen 80;

    root <path_to_gallery_installion>;

    access_log <path_to_log_locations>;
    error_log <path_to_log_locations>;

    index index.php;

    location / {

        location ~ /(index\.php/)?(.+)$ {
            try_files $uri /index.php?kohana_uri=$2&$args;
            location ~ /var/thumbs/.*/.album.jpg {
                # Direct access to album thumbs explicity allowed
            }
            location ~ /\.(ht|tpl(\.php?)|sql|inc\.php|db)$ {
                deny all;
            }
            location ~ /var/(uploads|tmp|logs) {
                deny all;
            }
            location ~ /bin {
                deny all;
            }
            location ~ /var/(albums|thumbs|resizes) {
                rewrite ^/var/(albums|thumbs|resizes)/(.*)$ /file_proxy/$2 last;
            }
            location ~* \.(js|css|png|jpg|jpeg|gif|ico|ttf)$ {
                try_files $uri /index.php?kohana_uri=$uri&$args;
                expires 30d;
            }
        }

        location = /index.php {
            include fastcgi_params;
            fastcgi_index index.php;
            fastcgi_split_path_info ^(.+\.php)(.*)$;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param PATH_INFO $fastcgi_path_info;
            fastcgi_pass localhost:9000;
        }
    }
}

But the real trick that made all the above work correctly was to change one line on application/config/config.php:

$config["index_page"] = "";

So simple. And everything just automagically started to work again.

This needs to be written somewhere where it can be easily googled for! (I've already submitted a feature request on GitHub).

Cheers, fellow gallerians!

    - Gwyn


JR

unread,
Feb 11, 2021, 7:00:49 PMFeb 11
to gallery...@googlegroups.com

Gwyneth,

Congratulations on getting this to work -- and *thank you* so much for posting the details of the working configuration! I'm sure this information will prove invaluable to some people looking to do something similar.

-- J.R.

--
WHEN USING AN EMAIL PROGRAM to reply to this message, click REPLY TO LIST or REPLY TO ALL so your reply goes out to everyone in the group. If you click REPLY or REPLY TO SENDER Google will *only* send your reply to the original author (not recommended).
 
To post a NEW MESSAGE to the group, send an new email to:
gallery...@googlegroups.com
 
To view or sign in to this group on the web, use this URL:
https://groups.google.com/forum/#!forum/gallery-3-users
---
You received this message because you are subscribed to the Google Groups "Gallery 3 Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gallery-3-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gallery-3-users/472c7c3e-a197-4c2d-9341-50146da37213n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages