Home >Backend Development >PHP Problem >How to delete the built-in php on mac
How to delete the built-in php on mac: first check the rootless status; then find the php file through the "sudo find / -name php" command; then use "cd /private/etc/ sudo rm -rf php*" Just wait for the command to delete the PHP that comes with it.
Recommended: "PHP Video Tutorial"
Mac installation php environment , Delete the built-in php
rootless kernel protection
When deleting the php file, you will find that you do not have permission to delete it. The built-in php is protected by the system, close rootless
View rootless status
csrutil status //查看rootless状态 disabled //开启
Close rootless
Restart the computer and hold down Command R to enter the recovery partition. Then find the terminal in the utility bar and start running.
csrutil disable //关闭rootless reboot //重启
Turn on rootless
It is recommended to open rootless after deleting php
csrutil enable //开启rootless reboot
Delete the built-in php
sudo find / -name php //查找php文件 cd /private/etc/ sudo rm -rf php* cd /usr/bin sudo rm -rf php* cd /usr/include sudo rm -rf php cd /usr/lib sudo rm -rf php cd /usr/sbin/ sudo rm -rf php* cd /usr/share sudo rm -rf php*
The above is the detailed content of How to delete the built-in php on mac. For more information, please follow other related articles on the PHP Chinese website!