2

I'm trying to install php-posix on CentOS 6, with no luck:

$ yum install php-posix

Getting the following error:

Loaded plugins: downloadonly, fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.nluug.nl
 * epel: nl.mirror.eurid.eu
 * extras: ftp.nluug.nl
 * updates: ftp.nluug.nl
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-process.x86_64 0:5.3.3-27.el6_5 will be installed
--> Processing Dependency: php-common(x86-64) = 5.3.3-27.el6_5 for package: php-process-5.3.3-27.el6_5.x86_64
--> Finished Dependency Resolution
Error: Package: php-process-5.3.3-27.el6_5.x86_64 (updates)
           Requires: php-common(x86-64) = 5.3.3-27.el6_5
           Installed: php-common-5.4.30-1.el6.remi.x86_64 (@remi)
               php-common(x86-64) = 5.4.30-1.el6.remi
           Available: php-common-5.3.3-26.el6.x86_64 (base)
               php-common(x86-64) = 5.3.3-26.el6
           Available: php-common-5.3.3-27.el6_5.x86_64 (updates)
               php-common(x86-64) = 5.3.3-27.el6_5
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

Looks like I need to downgrade php-common?

Is that really necessary, how would I do this?

Tim Baas
  • 281
  • 2
  • 6
  • 15

3 Answers3

9

You have installed PHP from the remi repository.
Now you need also to install additional packages form this repository, like so:

yum install php-posix --enablerepo=remi
faker
  • 17,496
  • 2
  • 60
  • 70
  • Thanks! I think I copy pasted the install commands from somewhere.. Do you happen to know why someone would use the remi repository? – Tim Baas Jul 14 '14 at 17:55
  • Generally because it has newer versions as provided by the default CentOS repositories. – faker Jul 14 '14 at 17:56
  • I kept having `No package php_posix available.` before trying `yum install php-posix --enablerepo=remi`, which worked for me in Centos 7 PHP 7.1. – kiatng Dec 04 '19 at 02:50
1

Another way to install the posix extension is via the webtatic repo.

Run the following command to install the repo:

sudo rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm 

And this command to install the extension:

sudo yum install php55w-process

Important note:

As @faker stated in his reply, this will work only if also php-common (named php55w-common) is installed via webtatic repo as php55w-process depends on it.

Ask in the comments if you need help.

SimonW
  • 111
  • 4
  • 2
    If he was on a fresh system that would work. But `php55w-process` requires `php55w-common` which will conflict with the `php-common` from remi. This will not work in his situation. – faker Jul 20 '14 at 17:42
  • You are right, I'll add this info to the answer so others with a situation like mine will have an answer. – SimonW Jul 20 '14 at 19:28
0

The instructions for CentOS 6 do not work for CentOS 7 / RHEL 7 distributions, such as Amazon Linux 2. Looks like the extension package name has changed from PHP 5.x to PHP 7.x as well.

Install the POSIX process control extension for PHP 7.1:

sudo yum install php71-php-process -y

Confirm the extension is enabled and posix_*() functions are available:

php --ri posix
php -r 'print_r(get_defined_functions());' | grep posix