【问题标题】:Can't install PEAR无法安装梨
【发布时间】:2015-12-24 13:32:41
【问题描述】:
sudo php -d detect_unicode=0 go-pear.phar

无法创建 PHP 代码目录 ($php_dir) /usr/share/pear。

我需要更改 /usr/share 的权限吗?当前权限为 drwxr-xr-x

【问题讨论】:

标签: php pear osx-elcapitan


【解决方案1】:

从此链接:http://jason.pureconcepts.net/2012/10/install-pear-pecl-mac-os-x/ 使用此说明,您无需禁用“系统完整性保护”

The following instructions install PEAR and PECL on Mac OS X under /usr/local/. PECL is bundled with PEAR. So this is as simple as installing PEAR on Mac OS X.

PEAR is PHP’s Package Repository and makes it easy to download and install PHP tools like PHPUnit and XDebug. I specifically recommend these two for every PHP developer.

Download PEAR
curl -O http://pear.php.net/go-pear.phar
sudo php -d detect_unicode=0 go-pear.phar

Configure and Install PEAR
You should now be at a prompt to configure PEAR.

Type 1 and press return.
Enter: /usr/local/pear

Type 4 and press return.
Enter: /usr/local/bin

Press return

Verify PEAR. You should be able to type:

pear version

Eventually, if you use any extensions or applications from PEAR, you may need to update PHP’s include path.

【讨论】:

    【解决方案2】:

    /usr 文件夹受到保护。 您可以禁用 SIP,但这不是最佳选择。

    您可以为“安装库”选择1并将目录更改为 /usr/本地

    然后它将适用于所有其他地址。

    看看这个其他问题 https://apple.stackexchange.com/questions/237778/cant-write-to-usr-even-with-sudo

    【讨论】:

    • 我知道了:PHP Startup: Unable to load dynamic library 'grpc.so' (tried: /usr/lib/php/extensions/no-debug-non-zts-20180731/grpc.so (dlopen(/usr/lib/php/extensions/no-debug-non-zts-20180731/grpc.so, 0x0009): dlopen(): file not found: /usr/lib/php/extensions/no-debug-non-zts-20180731/grpc.so), /usr/lib/php/extensions/no-debug-non-zts-20180731/grpc.so.so (dlopen(/usr/lib/php/extensions/no-debug-non-zts-20180731/grpc.so.so, 0x0009): dlopen(): file not found: /usr/lib/php/extensions/no-debug-non-zts-20180731/grpc.so.so))
    猜你喜欢
    • 2011-07-22
    • 2013-02-19
    • 2012-04-20
    • 2011-09-29
    • 2017-04-13
    • 2012-02-01
    • 2011-06-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多