Failed to write error when installing intl extension on Os x El Capitan

mocak picture mocak · Oct 19, 2015 · Viewed 11.5k times · Source

I'm trying to install intl extension on Os x El Capitan. Every time i run sudo pecl install intl, i'm getting following error on the last step. I don't know why the copy operation failed. Is it a bug or am i missing something?

Any help is really appreciated!

Note: I have installed autoconf and icu4c correctly.

Build complete.
Don't forget to run 'make test'.

running: make INSTALL_ROOT="/private/tmp/pear/install/pear-build-rootM6zI6U/install-intl-3.0.0" install
Installing shared extensions:     /private/tmp/pear/install/pear-build-rootM6zI6U/install-intl-3.0.0/usr/lib/php/extensions/no-debug-non-zts-20121212/
running: find "/private/tmp/pear/install/pear-build-rootM6zI6U/install-intl-3.0.0" | xargs ls -dils
20728993   0 drwxr-xr-x  3 root  wheel     102 Oct 19 19:33 /private/tmp/pear/install/pear-build-rootM6zI6U/install-intl-3.0.0
20729918   0 drwxr-xr-x  3 root  wheel     102 Oct 19 19:33 /private/tmp/pear/install/pear-build-rootM6zI6U/install-intl-3.0.0/usr
20729919   0 drwxr-xr-x  3 root  wheel     102 Oct 19 19:33 /private/tmp/pear/install/pear-build-rootM6zI6U/install-intl-3.0.0/usr/lib
20729920   0 drwxr-xr-x  3 root  wheel     102 Oct 19 19:33 /private/tmp/pear/install/pear-build-rootM6zI6U/install-intl-3.0.0/usr/lib/php
20729921   0 drwxr-xr-x  3 root  wheel     102 Oct 19 19:33 /private/tmp/pear/install/pear-build-rootM6zI6U/install-intl-3.0.0/usr/lib/php/extensions
20729922   0 drwxr-xr-x  3 root  wheel     102 Oct 19 19:33 /private/tmp/pear/install/pear-build-rootM6zI6U/install-intl-3.0.0/usr/lib/php/extensions/no-debug-non-zts-20121212
20729923 864 -rwxr-xr-x  1 root  wheel  440756 Oct 19 19:33 /private/tmp/pear/install/pear-build-rootM6zI6U/install-intl-3.0.0/usr/lib/php/extensions/no-debug-non-zts-20121212/intl.so

Build process completed successfully
Installing '/usr/lib/php/extensions/no-debug-non-zts-20121212/intl.so'
ERROR: failed to write /usr/lib/php/extensions/no-debug-non-zts-20121212/intl.so (copy(/usr/lib/php/extensions/no-debug-non-zts-20121212/intl.so): failed to open stream: Operation not permitted)

Answer

simpleengine picture simpleengine · Oct 23, 2015

I had this same issue while trying to install intl.

Had to disable the System Integrity Protection like Dan Willis suggested.

  1. Restart your computer.

  2. When the screen goes black hold down command+r until you boot into the Recovery. You will see the OS X Utilities menu.

  3. Next open Terminal. Then enter the following command.

    csrutil disable

Make sure to write it down so you remember it.

  1. Restart your mac, let it start up normally.

  2. Open Terminal again and install INTL again

    sudo pecl install intl

It will now complete the installation.