Updating from PHP version 8.0.30 to PHP version 8.1.0

Hello,

I’m trying to update from PHP version 8.0.30 to PHP version 8.1.0 and I type:

sudo zypper install php8-8.1.0
[sudo] password for root:
Loading repository data...
Reading installed packages...
Package 'php8-8.1.0' not found.
Resolving package dependencies...
Nothing to do.
mamunson:~> sudo zypper addrepo --refresh https://packagehub.suse.com/SUSE/Products/SLE-Module-Public-Cloud/15.3/x86_64/product_s
le-module-public-cloud.repo
File '/SUSE/Products/SLE-Module-Public-Cloud/15.3/x86_64/product_sle-module-public-cloud.repo' not found on medium 'https://packagehub.suse.co
m/'
Abort, retry, ignore? [a/r/i/...? shows all options] (a): sudo zypper addrepo --refresh https://download.opensuse.org/repositories/server:php:
extensions/openSUSE_YourVersion/server:php:extensions.repo

Logically, typing this didn’t help either: sudo zypper install php8-8.1.0

Grateful for your guidance.

Where did you get this repository URL from? It is not valid for any openSUSE product.

packagehub.suse.com can only be used if you have a registered SUSE product e.g. SLE
SUSE Package Hub - How to use

From ChatGPT. Thanks for telling me!

As you learned, ChatGPT is not a reliable source for information like this.

On my Leap 15.5 system, I see php81 listed, and version 8.1.24 is available in the Backports update repo; you could try just installing php81 and use it that way.

Depending on your use case, it might be a better option to look into running it in a docker container.

1 Like

I came across this site: Install PHP 8.1 in openSUSE Leap, and Run the Symfony Application on It – Hanan

and tried this: sudo zypper addrepo -p 90 https://download.opensuse.org/repositories/devel:languages:php/openSUSE_Leap_15.5/devel:languages:php.repo but it returned an error.

Which is secret…
Post the complete output incl. the complete!!! commandline in Code-Tags:

Code-Tags

1 Like

Sorry, here it is: [sudo] password for root: dynamic-pd01:/home/mamunson # sudo zypper addrepo -p 90 https://download.opensuse.org/repositories/devel:languages:php/openSUSE_Leap_15.5/devel:languages:php.repo Adding repository 'devel:languages:php (openSUSE_Leap_15.5)' ..........................................................................[error] Repository named 'devel_languages_php' already exists. Please use another alias. dynamic-pd01:/home/mamunson #

Can I go ahead and choose solution no. 1?

dynamic-pd01:/home/mamunson # zypper install php8-cli
Retrieving repository 'Packman' metadata ...............................................................................................[done]
Building repository 'Packman' cache ....................................................................................................[done]
Loading repository data...
Reading installed packages...
'php8-cli' is already installed.
There is an update candidate for 'php8-cli' from vendor 'obs://build.opensuse.org/devel:languages:php', while the current vendor is 'SUSE LLC <https://www.suse.com/>'. Use 'zypper install php8-cli-8.2.15-lp154.150.1.x86_64' to install this candidate.
Resolving package dependencies...
Nothing to do.
dynamic-pd01:/home/mamunson # zypper install php8-cli-8.2.15-lp154.150.1.x86_64
Loading repository data...
Reading installed packages...
Resolving package dependencies...

Problem: the to be installed php8-cli-8.2.15-lp154.150.1.x86_64 requires 'php = 8.2.15', but this requirement cannot be provided
  not installable providers: php8-8.2.15-lp154.150.1.x86_64[devel_languages_php]
 Solution 1: Following actions will be done:
  install php8-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
    replacing php8-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
  install php8-bz2-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
    replacing php8-bz2-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
  install php8-ctype-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
    replacing php8-ctype-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
  install php8-curl-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
    replacing php8-curl-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
  install php8-dom-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
    replacing php8-dom-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
  install php8-fileinfo-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
    replacing php8-fileinfo-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
  install php8-gd-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
    replacing php8-gd-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
  install php8-gettext-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
    replacing php8-gettext-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
  install php8-iconv-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
    replacing php8-iconv-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
  install php8-mbstring-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
    replacing php8-mbstring-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
  install php8-mysql-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
    replacing php8-mysql-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
  install php8-openssl-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
    replacing php8-openssl-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
  install php8-pdo-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
    replacing php8-pdo-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
  install php8-phar-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
    replacing php8-phar-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
  install php8-sqlite-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
    replacing php8-sqlite-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
  install php8-tokenizer-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
    replacing php8-tokenizer-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
  install php8-xmlreader-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
    replacing php8-xmlreader-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
  install php8-xmlwriter-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
    replacing php8-xmlwriter-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
  install php8-zip-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
    replacing php8-zip-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
  install php8-zlib-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
    replacing php8-zlib-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
  install apache2-mod_php8-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
    replacing apache2-mod_php8-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
 Solution 2: do not install php8-cli-8.2.15-lp154.150.1.x86_64
 Solution 3: break php8-cli-8.2.15-lp154.150.1.x86_64 by ignoring some of its dependencies

Choose from above solutions by number or cancel [1/2/3/c/d/?] (c): 

Don’t install from devel:languages - that’s a precursor to the releases and may break things unless you know what you’re doing.

Just install from the backports repo - that should work fine. If you’re using btrfs for root (which is the default IIRC), then you can roll back if it breaks, but installing from the devel: repos is generally not recommended as I recall.

Your system should already have the backports repo installed, and if you install php81 as opposed to what you’re trying to install, it should live peacefully side-by-side with the php8 packages.

I already picked up solution 1 and now I have version PHP 8.2.15 (cli) not sure if I can reverse this now.

This was the reference I used: https://serverfault.com/questions/1116023/php-command-not-found-after-php8-install-on-opensuse-leap-15-4

If you’re using btrfs on your root partition, you can revert to the earlier snapshot. But since you went ahead, see if it works, and if it does…consider yourself fortunate. :slight_smile:

I guess you could also probably back it out by reinstalling what you installed with the version you removed.

1 Like

Thanks for all the input :grinning:

1 Like

I installed Docker but received this message when I type: docker --version docker info

[sudo] password for root: 
mamunson@dynamic-pd01:~> docker --version
Docker version 24.0.7-ce, build 311b9ff0aa93
mamunson@dynamic-pd01:~> docker info
Client:
 Version:    24.0.7-ce
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  0.11.2
    Path:     /usr/lib/docker/cli-plugins/docker-buildx

Server:
ERROR: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/info": dial unix /var/run/docker.sock: connect: permission denied
errors pretty printing info
mamunson@dynamic-pd01:~> 

I’ve never worked with Docker previously.

Please new problem-----new thread

2 Likes