OS X EI Capitan installation mcrypt, capitanmcrypt_PHP tutorial
OS X EI Capitan installs mcrypt, capitanmcrypt
OS X EI Capitan installs mcrypt (Original text of my blog: http://www.jmolboy.com/2015/12/01/mcrypt-extension-on-EI-Capitan/) December 01, 2015 Published in php extension
After the mac operating system was upgraded to 10.11.2 (OS Neither could be successfully installed; I was troubled for a long time. When installing after compilation, it always prompts
<span class="line">1</span> |
<span class="line">[cp: /usr/lib/php/extensions/no-debug-non-zts-20121212/#INST@17000#: Operation not permitted]</span> |
Finally found the problem
What the hell
When you enter the /usr/lib/php/extensions/ directory, you will find that the directory cannot be operated at all (manual copying and moving), and you do not have permission to use root in the terminal; but is it impossible? I am already a root user, why is it not allowed? It turns out that OSX 10.11 El Capitan has added a new security mechanism called System Integrity Protection (SIP), so for the directory
- /System
- /sbin
- /usr
- Does not contain (/usr/local/)
Only for system use, other users or programs cannot use it directly, and our /usr/lib/php/extensions/ happens to be within the protected scope
Ban SIP
So the solution is to disable the SIP protection mechanism. The steps are:
- Restart the system
- Hold Command R
- Menu "Utilities" ==>> "Terminal" ==>> Enter csrutil disable; after execution, it will output: Successfully disabled System Integrity Protection. Please restart the machine for the changes to take effect.
- Restart the system again
After disabling SIP, you can install it smoothly. Of course, you can re-enable SIP after installation. The method is the same as above, but the command is csrutil enable
Full installation
<span class="line">1</span> |
<span class="line">cd ~ ; mkdir mcrypt ; cd mcrypt</span> |
Download
libmcrypt2.5.8 and the php version of your system to the mcrypt directory
Unzip
<span class="line">1</span> |
<span class="line">tar -zxvf libmcrypt-2.5.8.tar.gz tar -zxvf php-5.5.27.tar.gz rm *.gz</span> |
Install libmcrypt
<span class="line">1</span> |
<span class="line">cd libmcrypt-2.5.8 ./configure make sudo make install</span> |
Install autoconf
<span class="line">1</span> |
<span class="line">cd ~/mcrypt curl -O http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz tar xvfz autoconf-latest.tar.gz cd autoconf-2.69/ ./configure make sudo make install</span> |
Compile mcrypt php extension
<span class="line">1</span> |
<span class="line">cd ../php-5.5.27/ext/mcrypt/ /usr/bin/phpize</span> |
The above will output:
<span class="line">1</span> |
<span class="line">Configuring for: PHP Api Version: 20121113 Zend Module Api No: 20121212 Zend Extension Api No: 220121212</span> |
Then compile:
<span class="line">1</span> |
<span class="line">./configure make sudo make install</span> |
The above will output:
<span class="line">1</span> |
<span class="line">Installing shared extensions: /usr/lib/php/extensions/no-debug-non-zts-20121212/</span> |
If there is an error (that I encountered):
<span class="line">1</span> |
<span class="line">cp: /usr/lib/php/extensions/no-debug-non-zts-20121212/#INST@17000#: Operation not permitted</span> |
It means you need to disable SIP first (see above for how to disable SIP)
Modify /etc/php.ini and add extension=mcrypt.so
Restart apache
<span class="line">1</span> |
<span class="line">sudo apachectl restart</span> |
Look at your phpinfo(); mcrypt information will appear;
(My blog original text: http://www.jmolboy.com/2015/12/01/mcrypt-extension-on-EI-Capitan/)

APHPDependencyInjectionContainerisatoolthatmanagesclassdependencies,enhancingcodemodularity,testability,andmaintainability.Itactsasacentralhubforcreatingandinjectingdependencies,thusreducingtightcouplingandeasingunittesting.

Select DependencyInjection (DI) for large applications, ServiceLocator is suitable for small projects or prototypes. 1) DI improves the testability and modularity of the code through constructor injection. 2) ServiceLocator obtains services through center registration, which is convenient but may lead to an increase in code coupling.

PHPapplicationscanbeoptimizedforspeedandefficiencyby:1)enablingopcacheinphp.ini,2)usingpreparedstatementswithPDOfordatabasequeries,3)replacingloopswitharray_filterandarray_mapfordataprocessing,4)configuringNginxasareverseproxy,5)implementingcachingwi

PHPemailvalidationinvolvesthreesteps:1)Formatvalidationusingregularexpressionstochecktheemailformat;2)DNSvalidationtoensurethedomainhasavalidMXrecord;3)SMTPvalidation,themostthoroughmethod,whichchecksifthemailboxexistsbyconnectingtotheSMTPserver.Impl

TomakePHPapplicationsfaster,followthesesteps:1)UseOpcodeCachinglikeOPcachetostoreprecompiledscriptbytecode.2)MinimizeDatabaseQueriesbyusingquerycachingandefficientindexing.3)LeveragePHP7 Featuresforbettercodeefficiency.4)ImplementCachingStrategiessuc

ToimprovePHPapplicationspeed,followthesesteps:1)EnableopcodecachingwithAPCutoreducescriptexecutiontime.2)ImplementdatabasequerycachingusingPDOtominimizedatabasehits.3)UseHTTP/2tomultiplexrequestsandreduceconnectionoverhead.4)Limitsessionusagebyclosin

Dependency injection (DI) significantly improves the testability of PHP code by explicitly transitive dependencies. 1) DI decoupling classes and specific implementations make testing and maintenance more flexible. 2) Among the three types, the constructor injects explicit expression dependencies to keep the state consistent. 3) Use DI containers to manage complex dependencies to improve code quality and development efficiency.

DatabasequeryoptimizationinPHPinvolvesseveralstrategiestoenhanceperformance.1)Selectonlynecessarycolumnstoreducedatatransfer.2)Useindexingtospeedupdataretrieval.3)Implementquerycachingtostoreresultsoffrequentqueries.4)Utilizepreparedstatementsforeffi


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

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Dreamweaver CS6
Visual web development tools

Atom editor mac version download
The most popular open source editor

SublimeText3 Chinese version
Chinese version, very easy to use

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