The reason for the error is that the mcrypt extension of php is not installed, but the constants of the encryption methods defined in the extension are used. Solution: Install the mcrypt extension
Specific steps:
1. Open the command line to install mcrypt: brew install mcrypt
2. Install the php-mcrypt extension: brew install php55-mcrypt (install your own version of php)
. Check if the extension is installed
php -m | grep mcrypt
php -i | grep mcrypt
<br>
<img src="http://image.codes51.com/Article/image/20160129/20160129115805_1368.png" alt="mac1011 php报错 Use of undefined constant MCRYPT_RIJNDAEL_128"> 4. Copy the mcrypt configuration to the directory of the php scan configuration
I The default-Will-config-free-scan-dir =/library/server/web/config/php 'can be found in the configure commit options in PHPINFO.
. ext-mcrypt.ini
or
sudo ln -s /usr/local/etc/php/5.5/conf.d/ext-mcrypt.ini /Library/Server/Web/Config/php/ext-mcrypt. ini
Finally:
sudo apachectl restartYou can also use another method to install:
http://jingyan.baidu.com/article/e3c78d644cf1ed3c4c85f5a8.html
The above introduces the mac1011 php error Use of undefined constant MCRYPT_RIJNDAEL_128, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.
<br>