How to delete php on mac: 1. Temporarily close rootless; 2. Enter the corresponding PHP directory and execute commands such as "sudo rm -rf php-fpm.conf.defaultphp.ini php.ini.default" Just delete php.
Recommended: "PHP Video Tutorial"
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. Turn off rootless
Check the rootless status
csrutil status //查看rootless状态 enable //开启
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 //重启
Open rootless
It is recommended to open rootless after deleting php
csrutil enable //开启rootless reboot
After upgrading to the new version of mac, it may The error is reported as follows: rm: php: Read-only file system
The solution is to close the system’s sip and then delete some files
Executesudo mount -uw /
and you can continue to uninstall~
Delete the built-in php
cd /private/etc/ && sudo rm -rf php-fpm.conf.defaultphp.ini php.ini.default cd /usr/bin/ && sudo rm -rf php php-config phpdoc phpize cd /usr/include && sudo rm -rf php //10.14之后没有此目录 cd /usr/lib && sudo rm -rf php cd /usr/sbin && sudo rm -rf php-fpm cd /usr/share && sudo rm -rf php cd /usr/share/man/man1 && sudo rm -rf php-config.1 php.1 phpize.1 cd /usr/share/man/man8 && sudo rm -rf php-fpm.8
The left is the directory, and the right is the delete command. Only php is deleted, and the php.so and other files referenced by apache are not deleted
ps: It is not recommended to delete the built-in php version. Because some The software may depend on the PHP environment. Although you can self-compile or use brew to install a new version of PHP, it is not recommended for novices. Remember to use TM to back up the system before operation so that you can restore the files after a mistake.
For more programming-related knowledge, please visit: Introduction to Programming! !
The above is the detailed content of How to delete php on mac?. For more information, please follow other related articles on the PHP Chinese website!

The article compares ACID and BASE database models, detailing their characteristics and appropriate use cases. ACID prioritizes data integrity and consistency, suitable for financial and e-commerce applications, while BASE focuses on availability and

The article discusses securing PHP file uploads to prevent vulnerabilities like code injection. It focuses on file type validation, secure storage, and error handling to enhance application security.

Article discusses best practices for PHP input validation to enhance security, focusing on techniques like using built-in functions, whitelist approach, and server-side validation.

The article discusses strategies for implementing API rate limiting in PHP, including algorithms like Token Bucket and Leaky Bucket, and using libraries like symfony/rate-limiter. It also covers monitoring, dynamically adjusting rate limits, and hand

The article discusses the benefits of using password_hash and password_verify in PHP for securing passwords. The main argument is that these functions enhance password protection through automatic salt generation, strong hashing algorithms, and secur

The article discusses OWASP Top 10 vulnerabilities in PHP and mitigation strategies. Key issues include injection, broken authentication, and XSS, with recommended tools for monitoring and securing PHP applications.

The article discusses strategies to prevent XSS attacks in PHP, focusing on input sanitization, output encoding, and using security-enhancing libraries and frameworks.

The article discusses the use of interfaces and abstract classes in PHP, focusing on when to use each. Interfaces define a contract without implementation, suitable for unrelated classes and multiple inheritance. Abstract classes provide common funct


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

SublimeText3 Linux new version
SublimeText3 Linux latest version

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver CS6
Visual web development tools