Search…

X3 Photo Gallery Support Forums

Search…
 
sp0
Topic Author
Posts: 11
Joined: 14 Feb 2021, 14:23

Ubuntu installation questions

16 Feb 2021, 05:43

I have set up X3 on a DigitalOcean instance under Ubuntu 20, PHP 7.4.  

I have fixed several things and the site still seems to run ok, but am stuck on these warnings in the diagnostics page:
  • Mod Headers: Undetectable
  • Default Timezone: Not specified
The timezone is set in Linux as UTC.

I found that the installation requirements in the documentation were incomplete and perhaps I have missed another thing or two.  Beyond the requirements in the documentation ("Standard PHP extensions, including [color=var(--primary-color)]GD[/color] (image resizing) and [color=var(--primary-color)]Mcrypt[/color] (login encryption)") I found that I needed to:
  • install php7.4-mbstring (without this I just got a spinning circle on the main page)
  • enable mod_rewrite (AllowOverride All in Apache; a2enmod rewrite)
  • I also added php-7.4-curl and php-zip for installation and testing
I'd be interested to know how I can fix the warnings; and if anyone has further instructions for installation I'd appreciate that.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Ubuntu installation questions

16 Feb 2021, 07:38

sp0 wrote:I have fixed several things and the site still seems to run ok, but am stuck on these warnings in the diagnostics page:
  • Mod Headers: Undetectable
  • Default Timezone: Not specified
We test for many things in X3 diagnostics, so that it's easier to diagnose actual problems when they happen. Depending on how PHP is installed on your server, some things like "Mod Headers" can't be detected so there is not much more we can do on our side. Mod headers are not required to run X3, and that's why there are no "warnings" from X3 if you get this feature as "Undetectable". However, you would want mod_headers to work properly if you want your server to assign cache-headers to file output ... You can simply check that by loading an image with browser network inspector open, and see if cache headers are assigned.
sp0 wrote:The timezone is set in Linux as UTC.
Timezone is not crucial either for X3, but if you have not assigned it in PHP, you might get PHP warnings. Besides, it's not your "Linux" timezone that is missing ... Timezone should be defined in your PHP ini config. X3 diagnostics just reports when it's not set.
https://stackoverflow.com/questions/322 ... p-ini-file
sp0 wrote:I found that the installation requirements in the documentation were incomplete and perhaps I have missed another thing or two.  Beyond the requirements in the documentation ("Standard PHP extensions, including [color=var(--primary-color)]GD[/color] (image resizing) and [color=var(--primary-color)]Mcrypt[/color] (login encryption)") I found that I needed to:
  • install php7.4-mbstring (without this I just got a spinning circle on the main page)
  • enable mod_rewrite (AllowOverride All in Apache; a2enmod rewrite)
  • I also added php-7.4-curl and php-zip for installation and testing
Sure, but we already test for mod_rewrite and mb_string in diagnostics. All these extensions (mbstring, mod_rewrite, curl and zipArchive) should part of default PHP installations, but I guess you installed a minimum version.
sp0 wrote:I'd be interested to know how I can fix the warnings; and if anyone has further instructions for installation I'd appreciate that.
If your only warnings are mod_header and timezone, they not not critical. You can resolve the timezone by adding a default timezone definition to your PHP. As for mod_header, is it installed? If not install it. If it's installed, and you have checked, then you can ignore "Undetectable" ... It just means we can't detect it in PHP.
 
sp0
Topic Author
Posts: 11
Joined: 14 Feb 2021, 14:23

Re: Ubuntu installation questions

16 Feb 2021, 07:53

OK, thanks, both warnings are gone.  For future readers, what I did was:
  • sudo a2enmod headers
  • edit php.ini and change timezone to "Europe/London" (I had wrongly assumed it would pick that up from the Ubuntu environment)
In terms of whether I did a "minimum" install, no, I just followed the guide to building a standard LAMP server here and did
  sudo apt install php libapache2-mod-php php-mysql
which I now understand didn't bring everything in.

All seems to be working ok now.  Very promising.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Ubuntu installation questions

16 Feb 2021, 09:04

Good job! Thanks for feedback  :star:
 
repiuk
Posts: 12
Joined: 03 Apr 2022, 15:43

Re: Ubuntu installation questions

20 Aug 2022, 07:18

I'm doing a fresh install with the latest and greatest Ubuntu 22.04. installed apache2, php 8.1.2 and libzip-dev and completely lost. x3_installer.php displays
Missing PHP ZipArchive
X3 installer requires PHP ZipArchive to be able to unzip an X3 release.
Missing PHP cURL
X3 installer requires PHP cURL to be able to install from a remote URL.

Lots of changes even /etc/php.ini is somewhere else...
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Ubuntu installation questions

20 Aug 2022, 08:11

repiuk wrote:Lots of changes even /etc/php.ini is somewhere else...
What's the question though? If those messages appear, then it basically means those PHP features are missing. Why they are missing, I can't say ... You will need to enable these PHP extensions.
 
repiuk
Posts: 12
Joined: 03 Apr 2022, 15:43

Re: Ubuntu installation questions

20 Aug 2022, 10:47

Ziparchive (and cURL was missing) cURL was easy. Found ziparchive (also easy once found :) ) The links in the diagnostics page didn't help much.

https://anto.online/code/how-to-enable- ... e-for-php/
 
repiuk
Posts: 12
Joined: 03 Apr 2022, 15:43

Re: Ubuntu installation questions

20 Aug 2022, 11:32

Hmm Diagnostics is not showing any problems after
sudo a2enmod rewrite

http://IP/index.php or  http://IP shows a spinning circle. The panel is working and gallery pages and uploading jpg are also working. Tried adding
RewriteBase /
in .htaccess (last line)

It's just a testsite only accessible through the IP number
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Ubuntu installation questions

20 Aug 2022, 11:45

So assuming you managed to install it then? What exactly is the problem now? Open up your browser developer tools and check for errors, because there will be one there if you just see a spinning circle.
 
repiuk
Posts: 12
Joined: 03 Apr 2022, 15:43

Re: Ubuntu installation questions

20 Aug 2022, 13:17

Started from scratch and diagnostics complained about Mysqli Extension and Mbstring Extension missing. Didn't pop up the first time. Now its working.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Ubuntu installation questions

21 Aug 2022, 01:13

repiuk wrote: Started from scratch and diagnostics complained about Mysqli Extension and Mbstring Extension missing. Didn't pop up the first time. Now its working.
I forgot to mention in my last post, I am guessing it's related to Mbstring, as that has been known to cause "infinite spinning circle" because the PHP output stops in the middle if it fails to read images that contain certain characters for example in IPTC. It's working now then? :punch: :star:
 
repiuk
Posts: 12
Joined: 03 Apr 2022, 15:43

Re: Ubuntu installation questions

21 Aug 2022, 02:51

Yes working perfectly. This is what I installed on a fresh Ubuntu 22.04

sudo apt install apache2
sudo groupadd webmasters
sudo adduser username webmasters
sudo chgrp -R webmasters /var/www
sudo chmod -R g=rwX /var/www
sudo apt install php libapache2-mod-php
sudo apt install php-cli
sudo apt install php-cgi
sudo apt install php-mysql
sudo apt install php-zip
sudo apt install php-curl
sudo chmod -R o=rwX /var/www/test
sudo apt install php-gd
sudo apt install php-xml
sudo apt install php-mbstring
sudo a2enmod rewrite
sudo a2enmod headers
sudo nano /etc/apache2/apache2.conf
<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>
sudo nano /etc/php/8.1/apache2/php.ini

[Date]
; Defines the default timezone used by the date functions
; https://php.net/date.timezone
date.timezone = Europe/Amsterdam
I'm wondering if sudo chmod -R o=rwX /var/www/test is the way to go to enable write access for X3???
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Ubuntu installation questions

21 Aug 2022, 07:53

repiuk wrote:I'm wondering if sudo chmod -R o=rwX /var/www/test is the way to go to enable write access for X3??
How it works on pro hosting and how it should work: The WWW file system is owned by the www-user (PHP), in which case files and folders are readable for all, and writeable for owner only, or files [644] folders [755]. Basically you should have same owner of the file system and the WWW-user, in which case you wouldn't need to worry about permissions.

If you are setting up your own server, then you might have different users, in which case you have to add write permissions for "group" or "others". It depends on your file system, but you need to assign WRITE permissions for the www-user.