Home » Php » phabricator – How to install PHP extension 'pcntl' on my Mac OSX

phabricator – How to install PHP extension 'pcntl' on my Mac OSX

Posted by: admin July 12, 2020 Leave a comment

Questions:

My operating system is:Mac OSX 10.11

I’m trying to install Phabricator on my Mac, when I execute the command of

phabricator cpopt$ ./bin/phd start

I got an error:

"ERROR: The PHP extension 'pcntl' is not installed. You must install it to run daemons on this machine."

I’ve search this problem on google and I got lots of solutions,but they all don’t work to me,I’m almost in despair.

How can I achieve that?

enter image description here

How to&Answers:

Do you have brew installed (read here to install http://brew.sh/)?

Try:

brew install php

or if you need to install PHP 5.6 with brew you could do this:

brew install [email protected]

Then to include it in your PATH (if it is not automatically added), it may be necessary to run the commands in the CLI you may need to update your path, e.g. (this is the case if you were to brew install [email protected] but was not the case when I just tested with brew install php – if you are using bash instead of zsh, change .zshrc to .bashrc.

echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/usr/local/opt/[email protected]/sbin:$PATH"' >> ~/.zshrc

If that doesn’t work, I wonder if phabricator is calling the right version of php.

Out of curiosity, what is the output you get from this? That is what phabricator is using to determine your php version.

/usr/bin/env php -v

Also… is your php.ini updated to have the pcntl extension? Run this to see your modules and look for pcntl:

php -i | grep pcntl

Double-check the php.ini that the php-cli is running:

php -i | grep php.ini

Answer:

I had to do this to install the platform.sh command line tool. This was the top hit in Google so I’m adding this information. The process I followed was as below.

In Terminal:

Add yourself to the ‘wheel’ user group.

sudo dscl . append /Groups/wheel GroupMembership <username>

Grant group write access to /usr/local/bin

sudo chmod -R g+w /usr/local/bin

Link libpng for brew

brew link libpng

Install pcntl for php (5.6 in my case)

brew install homebrew/php/php56-pcntl