0

I’m trying to follow this tutorial https://codingexplained.com/dev-ops/mac/installing-php-intl-extension-os-x-mavericks in order to install the PHP extension intl on my Mac.

However, when I launch the command sudo php install-pear-nozlib.phar. I get the following error in my Terminal:

[PEAR] Archive_Tar: failed to mkdir /usr/lib/php/pear/Archive
[PEAR] Console_Getopt: failed to mkdir /usr/lib/php/pear/Console
warning: pear/PEAR requires package "pear/Archive_Tar" (version >= 1.3.7)
warning: pear/PEAR requires package "pear/Structures_Graph" (recommended version 1.0.4)
warning: pear/PEAR requires package "pear/Console_Getopt" (recommended version 1.2.3)
warning: pear/PEAR requires package "pear/XML_Util" (recommended version 1.2.1)
[PEAR] PEAR: failed to mkdir /usr/lib/php/pear/OS
[PEAR] Structures_Graph: failed to mkdir /usr/lib/php/pear/docs/Structures_Graph/docs/html/media
[PEAR] XML_Util: failed to mkdir /usr/lib/php/pear/docs/XML_Util/examples

I don’t understand why it’s failing to make directories considering I’m using sudo for the command.

I thought it might be related to the root user, so I enabled it following these instructions https://coolestguidesontheplanet.com/enable-root-user-macos-sierra/, but that doesn’t change anything.

Anybody had this problem before?

Thanks in advance.

  • i think (not certain) that `/usr/lib` is part of the protection of `System Integrity Protection`, which prevents the modification of system files ... period e.g. even user root cant change these files and folders. You can look **[here](https://www.igeeksblog.com/how-to-disable-system-integrity-protection-on-mac/)** for a workaround. However, i chose to just forego disabling SIP, notionally a very good feature. Instead i chose to use homebrew and have my own php/apache/mysql, outside of apples' shipped versions. Homebew installs in `/usr/local/....'. – YvesLeBorg May 09 '17 at 13:21
  • 1
    yep, look at the **[accepted answer on this SO question](http://stackoverflow.com/questions/32893056/installing-pecl-and-pear-on-os-x-10-11-el-capitan-or-macos-10-12-sierra)**. I am delaying installing sierra fore reasons just like this. Every now release of osx comes with its bag of new bugs and features, a moving target. I need to deploy my current project before upgrading (and be down for an undetermined amount of time). – YvesLeBorg May 09 '17 at 13:30
  • @YvesLeBorg thank you for your help. I managed to install Pear and Pecl but now I have an issue where I try to install the `intl` extension using Pecl: `$ sudo pecl install intl` `Cannot install, php_dir for channel "pecl.php.net" is not writeable by the current user` `$ pecl config-get php_dir` `/usr/lib/php/pear` `$ ls -ld /usr/lib/php/pear` `ls: /usr/lib/php/pear: No such file or directory` I can’t understand why there is no directory… – IeriOggiDomani May 10 '17 at 08:03
  • `/usr/local/lib` ? – YvesLeBorg May 10 '17 at 14:06
  • Possible duplicate of [Installing pecl and pear on OS X 10.11 El Capitan or macOS 10.12 Sierra](https://stackoverflow.com/questions/32893056/installing-pecl-and-pear-on-os-x-10-11-el-capitan-or-macos-10-12-sierra) – cweiske May 29 '17 at 08:28

0 Answers0