Skip to content

Instantly share code, notes, and snippets.

@wmcdonald404
Last active November 18, 2024 16:11
Show Gist options
  • Save wmcdonald404/45be8efc92730335158daf7e8ec1db86 to your computer and use it in GitHub Desktop.
Save wmcdonald404/45be8efc92730335158daf7e8ec1db86 to your computer and use it in GitHub Desktop.
Vagrant - Gallery3 in a Vagrant Box

Gallery3 in a Vagrant Box

TL;DR: It doesn't work anymore.

[root@localhost ~]# cat /etc/fedora-release 
Fedora release 40 (Forty)

Install Prerequisites

[root@localhost ~]# dnf -y install git php httpd mariadb-server

MariaDB Database

[root@localhost ~]# systemctl enable mariadb
[root@localhost ~]# systemctl start mariadb
[root@localhost ~]# mysqladmin create gallery3
[root@localhost ~]# mysqlshow gallery3
Database: gallery3
+--------+
| Tables |
+--------+
+--------+

Apache Webserver

[root@localhost ~]# systemctl enable httpd
[root@localhost ~]# systemctl start httpd
[root@localhost ~]# curl -s localhost | grep '<h1>'
    <h1>Fedora Webserver <strong>Test Page</strong></h1>

Gallery3 Bits

[root@localhost ~]# git clone https://github.com/gallery/gallery3 /var/www/html/gallery3/
[root@localhost ~]# mkdir /var/www/html/gallery3/var
[root@localhost ~]# chown apache:apache /var/www/html/gallery3/var
[root@localhost ~]# ls -ld /var/www/html/gallery3/var
drwxr-xr-x. 1 apache apache 0 Nov  7 11:23 /var/www/html/gallery3/var
[root@localhost ~]# ip a s eth0 | awk '/inet /{ split($2,a,"/"); print a[1] }'
192.168.121.232

Installer Test

http://192.168.121.232/gallery3/ returns:

Gallery requires short_open_tag to be on.

http://192.168.121.232/gallery3/installer/ returns:

Blank screen

[root@localhost ~]# php -i | grep short
short_open_tag => Off => Off
[root@localhost ~]# vi /etc/php.ini 
208:short_open_tag = On
[root@localhost ~]# php -i | grep short
short_open_tag => On => On
[root@localhost ~]# systemctl restart httpd
[root@localhost ~]# php -v
PHP 8.3.13 (cli) (built: Oct 22 2024 18:39:14) (NTS gcc x86_64)
Copyright (c) The PHP Group
Zend Engine v4.3.13, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.13, Copyright (c), by Zend Technologies

Command Line Install

[root@localhost ~]# cd /var/www/html/gallery3
[root@localhost gallery3]# php installer/index.php 
PHP Fatal error:  Unparenthesized `a ? b : c ? d : e` is not supported. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in /var/www/html/gallery3/installer/installer.php on line 138
[root@localhost gallery3]# php installer/index.php -h localhost -u root -d gallery3
PHP Fatal error:  Unparenthesized `a ? b : c ? d : e` is not supported. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in /var/www/html/gallery3/installer/installer.php on line 138

References

Bare Commands

dnf -y install git php httpd mariadb-server
systemctl enable mariadb
systemctl start mariadb
mysqladmin create gallery3
mysqlshow gallery3
systemctl enable httpd
systemctl start httpd
git clone https://github.com/gallery/gallery3 /var/www/html/gallery3/
mkdir /var/www/html/gallery3/var
chown apache:apache /var/www/html/gallery3/var
ip a s eth0 | awk '/inet /{ split($2,a,"/"); print a[1] }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment