首页 > Mac OS X内置PHP如何扩展'pcntl'

Mac OS X内置PHP如何扩展'pcntl'

最近公司需要搭建Phabricator服务,用到了LAMP套件,其中在配置PHP时,需要扩展'pcntl'使用多进程,但在扩展时遇到了麻烦:

系统:
Mac OSX EI Capitan

PHP版本信息:(Mac OSX自带)
PHP 5.5.27 (cli) (built: Aug 22 2015 18:20:44)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies

具体情况如下:
使用 cpoptdeiMac:phabricator cpopt$ ./bin/phd start命令,终端提示

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

网上的安装'pcntl'基本上都是下面的方法:

首先下载一个php-5.4.24源代码包
进入源代码目录的 ext/pcntl/
cd /path/to/phpsrc/ext/pcnt/
phpize
make
sudo
make install
最后记得要修改系统php的php.ini,加载pcntl.so模块

我尝试了上面的方法,重新下载了一个对应版本的PHP安装包,执行上面的命令,但一直报下面的错误:

cpoptdeiMac:pcntl cpopt$ pwd
/Users/cpopt/Downloads/php-5.5.27/ext/pcntl
cpoptdeiMac:pcntl cpopt$ phpize
grep: /usr/include/php/main/php.h: No such file or directory
grep: /usr/include/php/Zend/zend_modules.h: No such file or directory
grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:        
Zend Module Api No:     
Zend Extension Api No:  
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.

cpoptdeiMac:pcntl cpopt$ 

于是我又Google了半天,找到这个问题的解决方案如下,但是也是出错,提示非法操作

cpopt$ sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include

目前为止,已经耗了一天时间了还没有解决,希望大家能够帮助我渡过难关!谢谢!


哥们解决了吗?? 我在MAC下也遇到了同样的问题


我也有类似的报错:

    grep: /usr/include/php/main/php.h: No such file or directory
    grep: /usr/include/php/Zend/zend_modules.h: No such file or directory
    grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory
    Configuring for:
    PHP Api Version:
    Zend Module Api No:
    Zend Extension Api No:

最后在stackoverflow 上找到一个类似的问题

【热门文章】
【热门文章】