2

I am trying to install php 5.6 on centos 8. I understand it is no longer supported (eol), but due to an old project, it needs it. I have tried:

sudo dnf --enablerepo=remi install php56

Installs with no issue, hitting localhhost/ throws an error Running php --version gives me an error

bash: /usr/bin/php: No such file or directory

Howver running php56 --version works.

How do i make it such that any reference to php will use php56?

1 Answers1

1

The Software Collections are designed for parallel installation of multiple versions. So you have to enable the collection of the version you want.

Example:

$ module load php80
$ php -v
PHP 8.0.9 (cli) (built: Jul 29 2021 12:53:58) ( NTS gcc x86_64 )
$ module load php56
$ php -v
PHP 5.6.40 (cli) (built: Jun 28 2021 00:00:00) 

For web server, if only one version is installed, it will be used for all pages.

If multiple versions are installed you have to set the proper handler (socket path) for each vhost / project / directory to use the wanted FPM backend.

How do i make it such that any reference to php will use php56?

If you really need only one version, you can also install the php56-syspaths package, which provides /usr/bin/php (a symlink)

Remi Collet
  • 6,198
  • 1
  • 20
  • 25