$ Brew Install Php70-mcrypt
Error:
Error:parent directory is world writable and not sticky
Search for the answers to GitHub
https://github.com/Homebrew/legacy-homebrew/issues/40345
Reason:
/tmp directory permissions are incorrect
$ ls-ld/private/tmp
Print it out,/private/tmp is marked yellow.
Workaround:
$ sudo chmod +t/tmp
$ ls-ld/private/tmp
Print out/private/tmp is marked green, should be said to be normal meaning
Execute again
$ Brew Install Php70-mcrypt
Installation Successful
Knowledge Points:
chmod +t
+t to set the sticky bit (sticky bit) to prevent files or directories from being deleted by the non-owner
Set UID, a detailed description of the three permissions of the Gid,sticky bit:
A file has an owner that indicates who created the file. Also, the file has a group number that represents the group to which the file belongs, typically the group to which the file owner belongs.
If it is an executable file, at execution time, the file typically has only the permissions of the user who called the file. And setuid, Setgid can change this setting.
Setuid: Sets the permission to have the file owner in the execution phase of the file. The typical file is/usr/bin/passwd. If the file is executed by an average user, the file can be rooted during execution so that the user's password can be changed.
Setgid: This permission is valid only for the directory. After the directory is set, any user who creates the file in this directory has the same group as the group to which the directory belongs.
Sticky bit: This bit can be understood as an anti-delete bit. Whether a file can be deleted by a user depends primarily on whether the group to which the file belongs has write access to the user. Without write permissions, all files in this directory cannot be deleted and new files cannot be added. If you want users to be able to add files but cannot delete files at the same time, you can use the sticky bit bit for the file. When this bit is set, the file cannot be deleted even if the user has write access to the directory.
Mac Brew installation PHP extension error: Parent directory is world writable but not sticky