Php -v command not found error

SYSTEM INFORMATION
OS type and version Linux, CentOS 8
Virtualmin version 7.0

When trying to use php -v in console I get PHP command not found.

I have PHP 7.4.29 and PHP 8.1 installed. When looking at what version is enabled and default, 7.4 is enabled but 7.2 still shows as default. Is there a way to change the default to 7.4? I feel that will fix the PHP command not found error.

Centos8 is eol!

You did install the extra versions exact this way?
Multiple PHP Versions – Virtualmin

And result of this?
https://www.virtualmin.com/documentation/web/multiplephp/#Configuring_the_second_PHP_Version_in_Virtualmin

And for the virt servers use a phpinfo file to call in browser… results?

Try also in SSH …

As root in vmin 6.x in console on alma8x multiple remi php i have a version under php -v for your information.

All of CentOS is EoL as of 2024.

EDIT: I found it, had to scroll. Template PHP 7.4 configuration file is set to Default.

Still have this issue and I’m not sure what to do to fix it.

You didn’t write what i asked you before could be handy for support to know?

You did install the extra versions exact this way?
Multiple PHP Versions – Virtualmin

And result of this?
https://www.virtualmin.com/documentation/web/multiplephp/#Configuring_the_second_PHP_Version_in_Virtualmin

And simple with

And for the virt servers use a phpinfo file to call in browser… results?

But for all the CENTOS8 could be some out of support somewhere i don’t know the remi php repo does still support it for example?

Yes, I followed the instructions for Multiple PHP Versions - Virtualmin, the result of configuring is the same result, PHP -v command was not found. I even set PHP 7.4.29 to default but 8.1 is set to default as well.

Here is my phpinfo() page: PHP 8.1.6 - phpinfo()

I didn’t install Remi PHP because I don’t want to use something dependent on an OS that is end of life in 2024.

UH???

While in Multiple PHP Versions – Virtualmin

Installing PHP 7.3, 7.4 and/or 8.0 on CentOS 8

Install Remi Release repo and clear cache

Your phpinfo say

Build Provider Remi’s RPM repository https://rpms.remirepo.net/

/var/opt/remi/php81/log/php-fpm/www-error.log  ?

i cant help have not that version and OS but now for others and support they have more infos

Not sure why my phpinfo shows as Remi when I didn’t specifically tell it to install a Remi repo. I’ll see about following the install guide for the Remi release repo and clearing the cache.

After viewing the Remi Release site and reading some stuff I realized what I was doing wrong. I needed to do it like so php74 -v or php81 -v

1 Like

Uh Yup for me long time ago sorry i didn’t remember, that is if you change the default then not the (PHP) package from The OS itself .

I think, while i have the default PHP from the OS package there is php -v wroking.

And the Multiple Remi extra for virtual servers.

It could also be that you need the fpm part in that for asome i don’t remember

Yup there you installed the Remi Repo as in that manual for multi PHP versions. :wink:

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.