Error in mcrypt after upgrading into El Capitan OS

2019-02-28 08:32发布

I just upgraded my OS into El Capitan. I had to do some changes in my apache configurations to make everything works as it did before.

Thanks for - http://coolestguidesontheplanet.com/get-apache-mysql-php-and-phpmyadmin-working-on-osx-10-11-el-capitan/

One thing that is not working for me is the Mcrypt extension. Anyone knows how to update it to make it work?

3条回答
时光不老,我们不散
2楼-- · 2019-02-28 09:08

Can be a problem related to the new System Integrity Protection or "SIP"? Maybe could be helpful to check permission on the /usr folder and change them as needed.

查看更多
别忘想泡老子
3楼-- · 2019-02-28 09:11

If you look at Coolest Guides On The Planet's separate page for mcrypt they suggest disabling SIP. But there's a way to get around that. Follow the guide as normal (skipping the SIP part) and after running /usr/bin/phpize you can overide the extensions directory make is using.

First create a new home for your php extensions:

mkdir -p /usr/local/lib/php/extensions

Then run:

./configure

make

sudo make EXTENSION_DIR='/usr/local/lib/php/extensions' install

And finally, when you add the extension to your php.ini the most straightforward option is to include the full path to the file.

extension=/usr/local/lib/php/extensions/mcrypt.so

So far this is working for me.

Indirect references:
Error configuring mcrypt after upgrading to El Capitan (Ask Different)
Comment by Jon Gardner that started me on the path

查看更多
\"骚年 ilove
4楼-- · 2019-02-28 09:25

After upgrading to El Capitan, mcrypt.so has been moved from

/usr/lib/php/extensions/no-debug-non-zts-20121212

to

/Library/SystemMigration/History/Migration-(UUID)/QuarantineRoot/usr/lib/php/extensions/no-debug-non-zts-20121212/mcrypt.so

To be able to copy back the moved file, first, you must disable SIP as described here http://www.howtogeek.com/230424/how-to-disable-system-integrity-protection-on-a-mac-and-why-you-shouldnt

Then copy back the moved mcrypt.so to /usr/lib/php/extensions/no-debug-non-zts-20121212

Finaly restart Apache

查看更多
登录 后发表回答