首页 文章

mac osx上的php_posix

提问于
浏览
1

我正在尝试在Mac OsX 10.6上启用php_posix函数支持php 5.3.6 .

虽然php doc说posix函数默认启用,(http://php.net/manual/en/posix.installation.php

如果我使用posix_isatty()函数运行php脚本,我会收到一个错误:致命错误:调用未定义的函数posix_isatty()

??

我的safe_mode按照php文档的建议设置为Off . 我使用macport来安装php,似乎他们没有使用--disable-posix .

这是我的phpinfo()部分证明了它:

配置命令'./configure'' - prefix = / opt / local'' - mandir = / opt / local / share / man'' - infodir = / opt / local / share / info'' - with -config-file-path = / opt / local / etc / php5'' - with-config-file-scan-dir = / opt / local / var / db / php5'' - disable-all'' - enable-bcmath'' - enable-ctype'' - enable-dom'' - enable-fileinfo'' - enable-filter'' - enable-hash'' - enable-json'' - enable -libxml'' - enable-pdo'' - enable-phar'' - enable-session'' - enable-simplexml'' - enable-tokenizer'' - enable-xml'' - enable- xmlreader'' - enable-xmlwriter'' - with-bz2 = / opt / local'' - with-mhash = / opt / local'' - with-pcre-regex = / opt / local'' - with-readline = / opt / local'' - with-libxml-dir = / opt / local'' - with-zlib = / opt / local'' - without-pear'' - disable-cgi'' --with-apxs2 = /选择/本地/ Apache2的/ bin中/ APXS'

如果我运行 php -m ,php_posix不会出现在模块列表中 .

所以我在这一点上的结论是:它没有安装 .

我该如何安装?

2 回答

  • 5

    我认为问题是,你正在使用交换机"--disable-all",据我所知,它会停用包括posix在内的所有扩展 . 我建议在不使用"--disable-all"的情况下构建PHP,如果确实需要停用某些扩展名,请使用特定于扩展名的"--disable..."开关 .

  • 2

    Mac Ports有一个PHP Posix模块包:

    sudo port install php55-posix
    

    将55替换为您安装的php版本 .

相关问题