Mac OS Sierra Install PHP extension operation not permitted

Source: Internet
Author: User
Tags phpinfo zts

Want to see the detailed interpretation of can point here only need to solve the problem just look down.

---------------------------------------------------Split Line-------------------------------------------------------

Mac OS Sierra installs PHP extensions, and at the time of make install, a similar

CP:/usr/lib/php/extensions/no-debug-non-zts-20131226/#[email protected]12567#: Operation not permittedmake: * * [install1

The error is because the OS X 10.11 El Capitan started, adding a new security mechanism called system Integrity Protection systems Integrity Protection (SIP), so for the directory
/system
/sbin
/usr
Not included (/usr/local/)
For system use only, other users or programs cannot be used directly, and our/usr/lib/php/extensions/is just within the protected range.

The solution is

To disable the SIP protection mechanism:

    1. Rebooting the system
    2. Press and hold COMMAND + R (after re-lighting the screen, start pressing, symbolically press for a few seconds and then release, the Apple logo appears, OK)
    3. Menu "Utility" ==>> "terminal" ==>> input csrutil disable; output after execution: successfully disabled System Integrity Protection . Please restart the machine for the changes and take effect.
    4. Rebooting the system

After the SIP is forbidden, it can be installed smoothly, of course, after it is finished, remember to reopen the SIP, the same way, but the command is csrutil enable.

Additional Mac OS to install the Redis extension process for PHP:

Curl-o https://Nodeload.github.com/nicolasff/phpredis/zip/masterTar-zxf Master CD Phpredis-master/phpize./Configure Make  sudo  Make Install# Tips/usr/lib/php/extensions/no-debug-non-zts-xxxxxxxxx/indicates success vim/etc/php.ini (if not, copy the/etc/Php.ini.default and rename) # Add the following sentence to tell PHP to enable the Redis extension, save the file extension=redis.so #重启apachesudoapachectl Restart #查看扩展安装情况, Redis appears to indicate a successful installation. or see Phpinfo () PHP-M |grepRedis

In addition: I have had a rather lame question:

Php-m |grep Redis View does have a redis extension installed, but Phpinfo does not, of course, the startup project is also not supported Redis (tp3.2), the above process has been checked several times for a long time, and then
Php-i found that the PHP installation path that is viewed in the terminal is different from the php.ini path I modified, so it is not that I have installed the extended PHP, but another PHP installed in my system.
Say this question also blame oneself, the system comes with a PHP, with homebrew installed two version of PHP, through the command line directly has installed a PHP, not chaos only strange, later removed the homebrew installed PHP, using the system comes with,
Do the above again and solve the problem.
A switch PHP version is recommended: MacOS Sierra installs Apache and multiple versions of PHP switching are fully spoken.

Mac OS Sierra Install PHP extension operation not permitted

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.