User Tools

Site Tools


unix:linux:debian:devuan_sury

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
unix:linux:debian:devuan_sury [2020/05/19 00:12] rodolicounix:linux:debian:devuan_sury [2023/03/14 21:13] (current) – c rodolico
Line 3: Line 3:
 ===== Summary ===== ===== Summary =====
  
-In February 2020, the "go to" place to do multiple PHP installations on Debian based servers decided to create a dependency for system-d to the package. Installing or upgrading a Devuan system that used this site would result in an unusable web server. The package maintainer, who has been doing this work faithfully for almost a decade and whom the community owes a debt of gratitude to for his hard work, determined that the package for Debian based systems would not be changed; system-d would be required for any packages installed with his site as a source.+In February 2020, the "go to" place to do multiple PHP installations on Debian based servers decided to create a dependency for system-d to the package. Installing or upgrading a Devuan system that used this site would result in an unusable web server. The package maintainer, who has been doing this work faithfully for almost a decade and whom the community owes a debt of gratitude to for his hard work, determined that the package for Debian based systems would not be changed; systemd would be required for any packages installed with his site as a source.
  
-One of the users at Devuan has taken the original packages, modified them so they do not need system-d, and created a secondary location where the packages can be installed from. If you are using a non-system-d system, you will want to convert to this new site //before// you perform your new update. I will update this page for more details, but the following code will do this. Basically, change /etc/apt/sources.list.d/php.list to hold the packages form tdrnetworks.com. See links at the bottom of this article for more information.+One of the users at Devuan has taken the original packages, modified them so they do not need systemd, and created a secondary location where the packages can be installed from. If you are using a non-systemd system, you will want to convert to this new site //before// you perform your new update. I will update this page for more details, but the following code will do this. Basically, change /etc/apt/sources.list.d/php.list to hold the packages form tdrnetworks.com. See links at the bottom of this article for more information.
  
-===== Code =====+These instructions were written for devuan ascii and php 7.4, but are applicable for more recent versions of Devuan and PHP. **NOTE**: you can also downgrade if you want; you can install versions as far back as PHP 5.6. 
 + 
 +===== Set up tdnetworks.com PHP repository =====
  
 To verify sury is being used for PHP, execute the following. If it returns any values, you have it set up and need to fix it. If not, you may be using it but not have used the default setup. To verify sury is being used for PHP, execute the following. If it returns any values, you have it set up and need to fix it. If not, you may be using it but not have used the default setup.
Line 15: Line 17:
 </code> </code>
  
-If the above returns any lines, you can use the following to set up using tdnetworks.com+If the above returns any lines, you are currently set up to use sury.org, and need to convert to tdnetworks.com. The following script will work for new installs or existing installs. It assumes any existing additional php installations are defined in /etc/apt/sources.list.d/php.list, and renames if it exists.
  
 <code bash> <code bash>
 # get apt-transport-https if it is not installed # get apt-transport-https if it is not installed
-apt install apt-transport-https+apt install apt-transport-https gnupg
 # download key using wget and sending to stdout, then add using apt-key # download key using wget and sending to stdout, then add using apt-key
 wget -qO - http://pkgs.tdrnetworks.com/apt/devuan/gpg.key | apt-key add - wget -qO - http://pkgs.tdrnetworks.com/apt/devuan/gpg.key | apt-key add -
-save old file as .disabled +If php.list exists, move it to php.list.disabled 
-mv  /etc/apt/sources.list.d/php.list  /etc/apt/sources.list.d/php.list.disabled +if [ -e /etc/apt/sources.list.d/php.list ] ; then mv /etc/apt/sources.list.d/php.list  /etc/apt/sources.list.d/php.list.disabled ; fi 
-# create new list file +# create new list file. Change lsb_release -sc gets the code name to whatever your release is 
-echo 'deb https://pkgs.tdrnetworks.com/apt/devuan ascii main' >> /etc/apt/sources.list.d/php.list +echo deb https://pkgs.tdrnetworks.com/apt/devuan `lsb_release -sc` main > /etc/apt/sources.list.d/php.list 
-echo 'deb-src https://pkgs.tdrnetworks.com/apt/devuan ascii main>> /etc/apt/sources.list.d/php.list+echo deb-src https://pkgs.tdrnetworks.com/apt/devuan `lsb_release -sc` main >> /etc/apt/sources.list.d/php.list
 # update # update
 apt update apt update
 </code> </code>
-<code> + 
-apt-get install php7.php7.2-cli php7.2-cgi php7.2-fpm php7.2-gd php7.2-mysql php7.2-imap php7.2-curl php7.2-intl php7.2-pspell php7.2-recode php7.2-sqlite3 php7.2-tidy php7.2-xmlrpc php7.2-xsl php7.2-zip php7.2-mbstring php7.2-soap php7.2-opcache php7.2-common php7.2-json php7.2-readline php7.2-xml+The following will install various versions of PHP. This is taken from the excellent article at [[https://www.howtoforge.com/tutorial/how-to-install-php-7-for-ispconfig-3-from-debian-packages-on-debian-8-and-9/]] 
 + 
 +===== Install ===== 
 + 
 +==== PHP 7.4 ==== 
 +<code bash
 +apt -install php7.php7.4-cli php7.4-cgi php7.4-fpm php7.4-gd php7.4-mysql php7.4-imap php7.4-curl php7.4-intl php7.4-pspell php7.4-sqlite3 php7.4-tidy php7.4-xmlrpc php7.4-xsl php7.4-zip php7.4-mbstring php7.4-soap php7.4-opcache libonig5 php7.4-common php7.4-json php7.4-readline php7.4-xml
 </code> </code>
  
 +==== PHP 8.0 ====
 +<code bash>
 +apt -y install php8.0 php8.0-cli php8.0-cgi php8.0-fpm php8.0-gd php8.0-mysql php8.0-imap php8.0-curl php8.0-intl php8.0-pspell php8.0-sqlite3 php8.0-tidy php8.0-xsl php8.0-zip php8.0-mbstring php8.0-soap php8.0-opcache libonig5 php8.0-common php8.0-readline php8.0-xml
 +</code>
 +
 +==== PHP 8.1 ====
 +<code bash>
 +apt -y install php8.1 php8.1-cli php8.1-cgi php8.1-fpm php8.1-gd php8.1-mysql php8.1-imap php8.1-curl php8.1-intl php8.1-pspell php8.1-sqlite3 php8.1-tidy php8.1-xsl php8.1-zip php8.1-mbstring php8.1-soap php8.1-opcache libonig5 php8.1-common php8.1-readline php8.1-xml
 +</code>
 +
 +===== Clean Up =====
 +
 +After installing, the newest version of PHP will be set as default for many things. This will break some applications, specifically ISPConfig3 and older versions of Nextcloud.
 +
 +To allow you to reset the defaults, issue the following commands and choose the appropriate version of PHP.
 +
 +<code bash>
 +update-alternatives --config php
 +update-alternatives --config php-cgi
 +</code>
 +
 +Finally, restart all of the fpm packages you installed.
 +
 +<code bash>
 +service php7.4-fpm restart
 +service php8.0-fpm restart
 +service php8.1-fpm restart
 +</code>
 +
 +===== Problems =====
 +
 +==== Invalid Key ====
 +
 +tdrnetworks sometimes does not update their gpg key, causing the upgrades to fail. The quick and dirty way around it is to set that entry as "trusted."
 +
 +edit /etc/apt/sources.list.d/php.list
 +
 +<code>deb [trusted=yes] http://pkgs.tdrnetworks.com/apt/devuan beowulf main</code>
 +
 +This will turn off https, and set the domain to be trusted, so it will give a warning, but not an error.
 +
 +If you have used this entry before with apt. a cache will be stored on the system, and must be removed with.
 +
 +<code bash>rm /var/lib/apt/lists/pkgs.tdrnetworks.com*</code>
 +
 +The next time you apt update, it will rebuild that.
 +
 +
 +==== apc.so missing ====
 +
 +I found that when the new repository is used, it will have more recent versions of some of the existing php modules and will update them. Occasionally, I've found that, on Debian/Devuan systems, the apc.so library does not appear to be installed, and I end up with an error message like:
 +
 +**PHP Warning:  PHP Startup: Unable to load dynamic library 'apc.so' (tried: /usr/lib/php/20180731/apc.so (/usr/lib/php/20180731/apc.so: undefined symbol: zif_apcu_store), /usr/lib/php/20180731/apc.so.so (/usr/lib/php/20180731/apc.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0**
 +
 +The solution is to find which PHP version does not have the apcu module installed, then install it. The following BASH script will look for all versions of PHP and try to run them (using the -v, or version flag). Look for the one that gives you an error. This can be copied and pasted directly into the command line.
 +
 +<code bash>
 +#! /usr/bin/env bash
 +clear
 +for version in $(/usr/sbin/phpquery -V)
 +do
 +   echo ========
 +   echo Testing Version ${version}
 +   php${version} -v
 +done
 +</code>
 +
 +In my case, PHP 7.3 gave an error message, and 7.4 and 8.0 did not. So
 +<code bash>
 +apt install php7.3-apcu
 +</code>
  
 +fixed the problem.
 ===== References ===== ===== References =====
  
unix/linux/debian/devuan_sury.1589865127.txt.gz · Last modified: 2020/05/19 00:12 by rodolico