User Tools

Site Tools


linux:apps:php-update

Differences

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

Link to this comparison view

Next revision
Previous revision
linux:apps:php-update [2026/08/23 13:06] – created oscarlinux:apps:php-update [2026/08/23 13:13] (current) – oscar
Line 30: Line 30:
 </code> </code>
 === php.ini === === php.ini ===
-Save the old ///etc/php8.2/php.ini// +Save the old: /etc/php8.2/php.ini 
-//www.conf// +=== www.conf === 
-Save the old ///etc/php/8.2/fpm/pool.d/www.conf//+Save the old: /etc/php/8.2/fpm/pool.d/www.conf 
 + 
 +==== Install Sury Repository ==== 
 +<code> 
 +cd /tmp 
 +wget -q https://packages.sury.org/debsuryorg-archive-keyring.deb 
 +apt-get install ./debsuryorg-archive-keyring.deb 
 +. /etc/os-release 
 +cat << EOF > /etc/apt/sources.list.d/sury-php.sources 
 +Types: deb deb-src 
 +URIs: https://packages.sury.org/php 
 +Suites: $VERSION_CODENAME 
 +Components: main 
 +Signed-By: /usr/share/keyrings/debsuryorg-archive-keyring.gpg 
 +EOF 
 +apt-get update 
 +apt-cache policy php 
 +</code> 
 + 
 +==== Install php and packages ==== 
 +<code> 
 +apt install php8.4 php8.4-cli php8.4-cgi php8.4-fpm 
 +</code> 
 + 
 +Install custom packages: 
 +<code> 
 +apt install php8.4-apcu php8.4-bcmath php8.4-bz2 php8.4-cli php8.4-common php8.4-curl 
 +apt install php8.4-fpm php8.4-gd php8.4-gmp php8.4-igbinary php8.4-imagick 
 +apt install php8.4-intl php8.4-mbstring php8.4-memcached php8.4-msgpack 
 +apt install php8.4-mysql php8.4-opcache php8.4-readline php8.4-xml php8.4-zip 
 +</code> 
 + 
 +==== Update configuration ==== 
 +Update the /etc/php8.4/php.ini with the saved /etc/php8.2/php.ini 
 + 
 +Needed for NextCloud: 
 +/etc/php/8.4/fpm/pool.d/www.conf 
 + 
 +env[HOSTNAME] = $HOSTNAME 
 +env[PATH] = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 
 +env[TMP] = /tmp 
 +env[TMPDIR] = /tmp 
 +env[TEMP] = /tmp 
 + 
 + 
 +Configuring the Default PHP Version 
 + 
 +After installing additional PHP versions, if you want to set the OS default PHP version back to the one for your Debian release, run these commands: 
 + 
 +  update-alternatives --config php 
 +  update-alternatives --config php-cgi 
 + 
 +Update php in  
 +   fastcgi_pass unix:/var/run/php/php8.4-fpm.sock; 
 + 
 +/etc/nginx/sites-available/www.oscardegroot.nl 
 +/etc/nginx/sites-available/cloud.oscardegroot.nl 
 + 
 + 
 +   systemctl restart nginx 
 + 
 + 
 + 
 + 
  
 ==== Links ==== ==== Links ====
 [[https://wiki.debian.org/AdditionalPHPVersions]] [[https://wiki.debian.org/AdditionalPHPVersions]]
 +
  
  
linux/apps/php-update.1787490413.txt.gz · Last modified: by oscar