Laravel Horizon: requires ext-posix, missing from CentOS

Want to help support this blog? Try out Oh Dear, the best all-in-one monitoring tool for your entire website, co-founded by me (the guy that wrote this blogpost). Start with a 10-day trial, no strings attached.

We offer uptime monitoring, SSL checks, broken links checking, performance & cronjob monitoring, branded status pages & so much more. Try us out today!

Profile image of Mattias Geniar

Mattias Geniar, September 14, 2017

Follow me on Twitter as @mattiasgeniar

Here’s what I ran into when I tried to install a project that required laravel/horizon via Composer.

$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for laravel/horizon v1.0.3 -> satisfiable by laravel/horizon[v1.0.3].
    - laravel/horizon v1.0.3 requires ext-posix * -> the requested PHP extension posix is missing from your system.
...

The error message requires ext-posix * -> the requested PHP extension posix is missing from your system is actually confusing. On CentOS, there’s no PHP package called ‘posix’, even though the PHP module is called POSIX.

$ php -m | grep posix

(If that doesn’t return any results, the posix extension is missing.)

On CentOS, the package you’re looking for is called process, as it contains a set of functions/methods to help with creating child processes, sending signals, parsing ID/GIDs, …

If you’re using the IUS repositories on CentOS/Red Hat, you can install them via;

$ yum install php71u-process

Afterwards, if you run composer again, it’ll work. To verify if the posix extension is installed properly, run php -m again.

$ php -m | grep posix
posix

Now, the posix extension is installed.



Want to subscribe to the cron.weekly newsletter?

I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.

It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.

No spam. Just some good, practical Linux & open source content.