3

I'm trying to install libsodium (following this guide https://paragonie.com/book/pecl-libsodium/read/00-intro.md#installing-libsodium). When I attempt to use pecl install libsodium, I get the following result:

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

Can anyone tell me why this isn't working, and how I can overcome it?

thebarless
  • 470
  • 1
  • 12
  • 34
  • 2
    you might find some ideas here : http://stackoverflow.com/questions/36577020/failed-to-open-stream-no-such-file-or-directory. At first sight it seems that you don't have authorization to write to that directory – Vic Seedoubleyew May 15 '16 at 21:17

1 Answers1

0

I installed libsodium on MAMP using PECL. It's easy when everything is configured.

Basically you just need to

  1. check this checkbox on MAMP > PHP. Make sure to open a new terminal tab or restart it to make effect. enter image description here

  2. Run pecl install libsodium and follow the latest instruction enter image description here

Troubleshooting

I faced an issue related to GNU (autom4te: need GNU m4 1.4 or later: /Applications/MAMP/Library/bin/m4) when trying to install with PECL.

I solved it by following these steps after brew install m4.

Also, make sure xcode is installed and using latest versions (xcode-select --install).

I hope it helps.

Ricardo Martins
  • 5,702
  • 3
  • 40
  • 59