How can I install mcrypt under PHP7? Laravel needs it

前端 未结 9 1153
盖世英雄少女心
盖世英雄少女心 2020-12-01 04:16

Since Laravel4 requires mcrypt extension, and PHP7 doesn\'t seem to have mcrypt extension, is there any workaround for this to work?

9条回答
  •  一生所求
    2020-12-01 04:49

    do like this:

    1. wget http://jp2.php.net/distributions/php-7.0.3.tar.gz
    2. tar zxf php-7.0.3.tar.gz
    3. cd php-7.0.3/ext/mcrypt
    4. /php7-path/bin/phpize (when error such as configure: error: mcrypt.h not found. Please reinstall libmcrypt run apt-get install libmcrypt-dev)
    5. ./configure --with-php-config=/php7-path/bin/php-config
    6. (sudo) make && make install .this will install the mcrypt.so in php-7.0.3/ext/mcrypt/modules
    7. cp to the /usr/lib/php/20151012/ what is the shared extensions dir
    8. create a mcrypt.ini in /etc/php/mods-available/ write as extension=mcrypt.so
    9. create link to this such as sudo ln -s /etc/php/mods-available/mcrypt.ini 20-mcrypt.ini in /etc/php/7.0/fpm/conf.d
    10. create link to this such as sudo ln -s /etc/php/mods-available/mcrypt.ini 20-mcrypt.ini in /etc/php/7.0/cli/conf.d
    11. sudo service nginx restart
    12. sudo service php7.0-fpm restart
    13. yes it is.

提交回复
热议问题