Score:0

php command not found after PHP8 install on OpenSUSE Leap 15.4

cn flag

I have upgraded my OpenSUSE Leap from 15.3 to 15.4.

I then want to upgrade PHP from version 7 to version 8. Before upgrade, PHP version is:

server:~ # php -v
PHP 7.4.33 (cli) (built: Nov  3 2022 12:00:00) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
  with Zend OPcache v7.4.33, Copyright (c), by Zend Technologies

I first started with a classic installation:

server:~ # zypper install php8

After installation is done (no particular errors/warnings mentionned), I get this:

server:~ # php -v
-bash: /usr/bin/php: No such file or directory

I then followed the official documentation for packages management which suggests to add a specific repository. I just added option -r 1 to the install command to specify the repository ID I want to install from:

server:~ # zypper addrepo https://download.opensuse.org/repositories/home:illuusio:php-next/15.4/home:illuusio:php-next.repo
server:~ # zypper refresh
server:~ # zypper install -r 1 php8

After installation is done (no particular errors/warnings mentionned), I now get this:

server:~ # php -v
php: command not found

Both installations processes suggest to uninstall PHP7, which I did accept (I don't want to keep both php7 and php8 on my server).

I then checked these:

srv-dev01:~ # whereis php
php: /usr/share/php

srv-dev01:~ # ll /usr/share/php
total 0

I don't understand why php8 is not properly installed... I guess a link is probably needed in /usr/bin/ directory but, if so, I don't get why it is not done by the installation process... I'd like to do an install as clean as possible.

Thanks for help!

Score:0
in flag

Install the php-cli package.

zypper install php8-cli
wiltomap avatar
cn flag
That's it! Thanks... I still don't get why this package is not within default installation.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.