jameskimmel / Nextcloud_Ubuntu

Install Nextcloud on Ubuntu bare metal
GNU General Public License v3.0
16 stars 6 forks source link

Targeted PHP version support #5

Closed nztvar closed 10 months ago

nztvar commented 10 months ago

Many Debian/Ubuntu users prefer to install more-current versions of PHP packaged by Sury. The Ubuntu ppa installation instructions are here, and the Debian dpa installation instructions are here. These can allow one to install versions other than the current stable for any debian-based OS.

However, this then requires updating the PHP-installing bash to indicate the intended version to install, for example:

sudo apt-get install libapache2-mod-php8.3 
  php8.3-apcu \
  php8.3-bcmath \
  php8.3-bz2 \
  php8.3-ctype \
  php8.3-curl \
  php8.3-dom \
  php8.3-gd \
  php8.3-gmp \
  php8.3-imagick \
  php8.3-intl \
  php8.3-mbstring \
  php8.3-mysql \
  php8.3-posix \
  php8.3-redis \
  php8.3-xml \
  php8.3-zip
jameskimmel commented 10 months ago

Thank you for your suggestion.

To be honest, I am nowhere near experienced enough to make qualified statements about PHP packages. My old school thinking is this: Debian/Ubuntu comes with PHP X.X X.X is supported. X.X will probably not break things. X.X does not warn me about broken UTF8 X.X does not requiere me to change the installation X.X is probably easier to upgrade. New Ubuntu Y.Y comes out with PHP Z.Z. I don't need to change anything or adjust some config files that point to an old PHP version, because there is only one version installed (maybe I don't know better and this is not really a problem)

I think the best way would be to mention the outdated distro PHP und link to your explanation in the wiki. What do you think?

nztvar commented 10 months ago

Yes, this sounds like a reasonable compromise. You might replace the following paragraph:

Nextcloud currently recommends PHP 8.2 but Ubuntu 22.04 comes with PHP 8.1. I think it is easier to use a slightly outdated PHP version than to add PHP repositories. We install all the software that is needed plus some optional software so we won't get warnings in the Nextcloud Admin Center.

with something like this:

Different versions of Ubuntu may have differing versions of PHP, for example Ubuntu 22.04 ships PHP 8.1, which is not the current recommended. Adding optional repositories to apt's sources (e.g. Sury's ppa for Ubuntu or dpa for Debian) is beyond the scope of this tutorial, and will require modifying the name of libapache2-mod-php and all php modules to include the specific version number, e.g. libapache2-mod-php8.2 php8.2-apcu php8.2-bcmat and so on.

jameskimmel commented 10 months ago

added it into the tutorial. Thank you so much!