简体   繁体   English

无法安装梨

[英]Can't install PEAR

sudo php -d detect_unicode=0 go-pear.phar

Unable to create PHP code directory ($php_dir) /usr/share/pear.无法创建 PHP 代码目录 ($php_dir) /usr/share/pear。

Do I need to change permissions on /usr/share?我需要更改 /usr/share 的权限吗? Current permissions are drwxr-xr-x当前权限为 drwxr-xr-x

The /usr folder is protected. /usr 文件夹受到保护。 You can disable SIP, but this is not the best option.您可以禁用 SIP,但这不是最佳选择。

You can select 1 for the "Installation base" and change the directory to /usr/local可以选择“Installation base”为1,将目录改为/usr/local

Then it will apply to all other addresses.然后它将适用于所有其他地址。

Take a look on this other question https://apple.stackexchange.com/questions/237778/cant-write-to-usr-even-with-sudo看看这个其他问题https://apple.stackexchange.com/questions/237778/cant-write-to-usr-even-with-sudo

From this link: http://jason.pureconcepts.net/2012/10/install-pear-pecl-mac-os-x/ With this instructions, you don't need to disable 'System Integrity Protection'从此链接: 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.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM