3

When I command on my MacOS:

> sudo mv /usr/bin/php /usr/bin/php-52

I get the result:

mv: rename /usr/bin/php to /usr/bin/php-52: Operation not permitted

What can I do? Thanks!

1
  • Did you ensure that target partition mounted as readwrite? Jan 13 '16 at 15:29
10

Must be due to the flags - try sudo chflags nouchg /usr/bin/php

EDIT:

You need to press Cmd + R at boot time, open the terminal and then run csrutil disable and reboot.

5
  • Nothing changes: the command doesn't give any result; the operation is still not permited.
    – dxvargas
    Jan 13 '16 at 15:47
  • What does lsattr /usr/bin/php show?
    – Mugurel
    Jan 13 '16 at 15:49
  • I suppose in OS X (I gave this info only in the tag...) the command is "ls -lO" The result is: -rwxr-xr-x 1 root wheel restricted,compressed 10577504 Dec 3 06:35 php
    – dxvargas
    Jan 13 '16 at 15:54
  • 2
    Assuming you're running El Capitan, you need to press Cmd + R at boot time, open the terminal and then run csrutil disable and reboot. Should work after that. Can this question be moved to superuser.com? Not sure how to do it myself.
    – Mugurel
    Jan 13 '16 at 15:57
  • Yes, this worked! And the "chflags nouchg" wasn't necessary. Can you edit your answer to give this direct instruction?... Then I will accept it! I cannot move this to superuser.com .
    – dxvargas
    Jan 13 '16 at 16:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.