OS X EI Capitan Installation mcrypt,capitanmcrypt_php Tutorial

Source: Internet
Author: User
Tags mcrypt zts

OS X EI Capitan installation Mcrypt,capitanmcrypt


OS X EI Capitan installation MCrypt

(My blog Original: http://www.jmolboy.com/2015/12/01/mcrypt-extension-on-EI-Capitan/) December 01, 2015 Posted inPHP extensions

Mac operating system upgrade to 10.11.2 (OS X EI Capitan), the system comes with PHP has been modified to overwrite, the previous installation of PHP extension can not continue to use, and the mcrypt extension is urgently needed, but how to install the installation can not be successful; troubled for a long time. Always prompt when performing installation after compilation

1
[CP:/usr/lib/php/extensions/no-debug-non-zts-20121212/#INST @17000#: Operation not permitted]

Finally found the problem.

What the heck

When you enter the/usr/lib/php/extensions/directory you will find that the directory is not operational (manual copy, mobile), using root in the terminal also has no permissions; I am already a root user, why not allowed; it was OSX 10.11 El Capitan New added a new security mechanism called system Integrity Protection systems Integrity Protection (SIP), so for 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

SIP-Forbidden

Therefore, the solution is to disable the SIP protection mechanism, the steps are:

    • Rebooting the system
    • Hold COMMAND + R
    • Menu "Utility" ==>> "terminal" ==>> input csrutil disable; output after execution: successfully disabled System Integrity Protection. Please restart the machine for the changes and take effect.
    • Restart the system again

After the SIP is forbidden, it can be installed smoothly, of course, after you can open the SIP again, the same way, but the command is csrutil enable

Full installation

1
CD ~; mkdir MCrypt; CD MCrypt

Download separately
libmcrypt2.5.8, your system's PHP version to the MCrypt directory

Extract

1
TAR-ZXVF LIBMCRYPT-2.5.8.TAR.GZTAR-ZXVF php-5.5.27.tar.gzrm *.gz

Installing Libmcrypt

1
CD Libmcrypt-2.5.8./configuremakesudo make install

Installing autoconf

1
CD ~/mcryptcurl-o Http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gztar XVFZ AUTOCONF-LATEST.TAR.GZCD Autoconf-2.69/./configuremakesudo make Install

Compiling PHP extensions for MCrypt

1
Cd.. /php-5.5.27/ext/mcrypt//usr/bin/phpize

The above outputs:

1
Configuring for:php API Version:20121113zend Module API no:20121212zend Extension API no:220121212

Then compile:

1
./configuremakesudo Make Install

The above outputs:

1
Installing shared extensions:  /usr/lib/php/extensions/no-debug-non-zts-20121212/

If an error occurred (I encountered):

1
CP:/usr/lib/php/extensions/no-debug-non-zts-20121212/#INST @17000#: Operation not permitted

It means you need to cut out the SIP (how to disable SIP, see above)

Modify/etc/php.ini, add extension extension=mcrypt.so

and restart Apache.

1
sudo apachectl restart

Then look at your phpinfo (); The mcrypt message will appear;

(My blog Original: http://www.jmolboy.com/2015/12/01/mcrypt-extension-on-EI-Capitan/)

http://www.bkjia.com/PHPjc/1086206.html www.bkjia.com true http://www.bkjia.com/PHPjc/1086206.html techarticle OS X ei Capitan install mcrypt,capitanmcrypt OS x ei Capitan install mcrypt (my blog original: http://www.jmolboy.com/2015/12/01/ mcrypt-extension-on-ei-capitan/) December 01, 2015 released in ...

  • 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.