1

I am running two versions of PHP 7.4 and 8.4 on an Almalinux server and I'm missing a php function posix_getppid (in Laravel/Horizon).

I've searched and it seems I'm missing a PHP extension/module. I'm trying to install php-common for 8.4 as I read posix was included with that or else it's php-process but I'm getting the error below.

I may have made a mess of my original PHP on the server as it has now upgraded to php8.4 from 7.4, as I forgot to use the php84-php-** when installing extensions.

I have multiple sites that all were running on PHP7.4 and I was trying to add a new app that uses laravel 12 which requires 8.*

Error:
Problem: cannot install both php-common-7.4.33-24.el8.remi.x86_64 from remi-modular and php-common-8.4.10-1.el8.remi.x86_64 from @System

  • package php-process-7.4.33-24.el8.remi.x86_64 from remi-modular requires php-common(x86-64) = 7.4.33-24.el8.remi, but none of the providers can be installed
  • package php-pecl-imap-1.0.3-1.el8.remi.8.4.x86_64 from @System requires php(api) = 20240924-64, but none of the providers can be installed
  • package php-pecl-imap-1.0.3-1.el8.remi.8.4.x86_64 from @System requires php(zend-abi) = 20240924-64, but none of the providers can be installed
  • cannot install the best candidate for the job
  • problem with installed package php-pecl-imap-1.0.3-1.el8.remi.8.4.x86_64
  • package php-common-8.4.10-1.el8.remi.x86_64 from remi-modular is filtered out by modular filtering
  • package php-common-8.4.11-1.el8.remi.x86_64 from remi-modular is filtered out by modular filtering (try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

Installed PHP84 Modules

php84 --modules [PHP Modules] bcmath bz2 calendar Core ctype curl date dom exif fileinfo filter ftp gd gettext hash iconv json libxml mbstring mysql mysqli mysqlnd openssl pcntl pcre PDO pdo_mysql pdo_sqlite Phar posix random readline Reflection session shmop SimpleXML sockets sodium SPL sqlite3 standard sysvmsg sysvsem sysvshm tokenizer xml xmlreader xmlwriter xsl Zend OPcache zip zlib [Zend Modules] Zend OPcache 

Installed PHP Modules

php --modules [PHP Modules] apcu bcmath bz2 calendar Core ctype curl date dom exif fileinfo filter ftp gd gettext hash iconv igbinary imagick imap intl json libxml mbstring memcached msgpack mysqli mysqlnd openssl pcntl pcre PDO pdo_mysql pdo_sqlite Phar random readline redis Reflection session SimpleXML sockets sodium SPL sqlite3 standard tokenizer xml xmlreader xmlrpc xmlwriter xsl Zend OPcache zip zlib [Zend Modules] Zend OPcache 

2 Answers 2

2

Looks like you a re using package from my repository

For a proper repository configuration and usage, see the Wizard

For an example on running multiple PHP versions, see My PHP development Workstation

I usually recommend to install the newer version (8.4) as system default (php-* packages) and the old one, for legacy app as alternative version (php74-php-* packages)

To install posix extension for default php

dnf install php-posix 

To install posix extension for alternative php84

dnf install php84-php-posix 

I may have made a mess of my original php on the server as it has now upgraded to php8.4 from 7.4

Follow the wizard instructions to switch back to 7.4

dnf module switch-to php:remi-7.4 
0

You can install multiple PHP versions on your system and switch between them as needed.

The exact method depends on your operating system.

Maybe you should also work with containers in the future for development and testing.

This way, you'll always have isolated environments where you can use different programs, modules, configurations or packages for each project or environment, similar to Python's venv as an example.

Search the internet for PHP multiple versions.

If you messed something up, uninstall PHP completely, then calmly install version 7.x and the version 8.x you need and reinstall/activate the required modules for each version.

I know that RPM and DEB are different. The title isn't well chosen for the link/post, it was just about being able to use different versions and that there are different ways to find out your version (some paths and package manager commands maybe differ from), regardless of your package manager. Also, it may be that only certain 8.x versions have been tested and approved for other PHP applications or frameworks an if your software explicitly requires a specific PHP version, due to its age, a module, or other reasons.

Your development data should not be deleted in the process.

Still, you should always have a backup.

If possible, create Bash scripts to automate your entire installation, configuration and activation process.

You can reuse them on other systems.

2
  • Ubuntu howto are not relevant on RPM base distro Commented Aug 15 at 4:45
  • @Remi Collet I know that RPM and DEB are different. The title isn't well chosen, it was just about being able to use different versions and that there are different ways to find out your version(some paths and package manager commands maybe differ from), regardless of your package manager. Commented Aug 15 at 10:41

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.