简体   繁体   English

如何将 MCRYPT 路径设置回 MAMP Pro

[英]How to set MCRYPT path back to MAMP Pro

I've done installing MCRPYT at MAMP Pro with PHP 7.2 and I was able to run my old project Laravel 4.2.我已经使用 PHP 7.2 在 MAMP Pro 上安装了 MCRPYT,并且能够运行我的旧项目 Laravel 4.2。

Here are the list of what I have in my MAMP PHP.ini这是我的 MAMP PHP.ini 中的列表

extension=mcrypt.so

; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
extension_dir = "/Applications/MAMP/bin/php/php7.2.1/lib/php/extensions/no-debug-non-zts-20170718/"

But when I run which mcrypt it default to /usr/local/bin/mcrypt which I thought it should be under MAMP Pro.但是当我运行which mcrypt时,它默认为/usr/local/bin/mcrypt ,我认为它应该在 MAMP Pro 下。

The reason why I am asking this is because, I wanted to upgrade my project Laravel 4.2 to 5.0.我之所以问这个是因为,我想将我的项目 Laravel 4.2 升级到 5.0。 And here's the problem when I tried installing fresh Laravel 5.0这是我尝试安装新的 Laravel 5.0 时的问题

composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/framework v5.0.9 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.8 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.7 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.6 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.5 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.4 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.35 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.34 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.33 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.32 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.31 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.3 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.29 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.28 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.27 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.26 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.25 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.24 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.23 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.22 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.21 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.20 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.2 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.19 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.18 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.17 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.16 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.15 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.14 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.13 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.12 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.11 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.10 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.1 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework v5.0.0 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - laravel/framework 5.0.30 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
    - Installation request for laravel/framework 5.0.* -> satisfiable by laravel/framework[5.0.30, v5.0.0, v5.0.1, v5.0.10, v5.0.11, v5.0.12, v5.0.13, v5.0.14, v5.0.15, v5.0.16, v5.0.17, v5.0.18, v5.0.19, v5.0.2, v5.0.20, v5.0.21, v5.0.22, v5.0.23, v5.0.24, v5.0.25, v5.0.26, v5.0.27, v5.0.28, v5.0.29, v5.0.3, v5.0.31, v5.0.32, v5.0.33, v5.0.34, v5.0.35, v5.0.4, v5.0.5, v5.0.6, v5.0.7, v5.0.8, v5.0.9].

  To enable extensions, verify that they are enabled in your .ini files:
    - /Applications/MAMP/bin/php/php7.2.1/conf/php.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

Note笔记

If you wanted to know how I made to run Laravel 4.2 using PHP 7.2 with MCrypt.如果您想知道我是如何使用带有 MCrypt 的 PHP 7.2 运行 Laravel 4.2 的。 Check this link.检查此链接。

https://medium.com/@tomgrohl/making-laravel-4-2-work-with-php-7-2-e9149a9428c3 https://medium.com/@tomgrohl/making-laravel-4-2-work-with-php-7-2-e9149a9428c3

If php version lower than 7.1:如果 php 版本低于 7.1:

Install and enable mcrypt:安装并启用 mcrypt:

sudo apt-get install mcrypt php-mcrypt
sudo phpenmod mcrypt

Try to find your php.ini and open it.尝试找到您的 php.ini 并打开它。

vim php.ini

Put one line in to this file在此文件中放入一行

extension=mcrypt.so

Restart php and apache.重启 php 和 apache。

Else别的

Try to upgrade your laravel version greater than 5.5.尝试将您的 laravel 版本升级到 5.5 以上。 like:喜欢:

     "laravel/framework": "5.5.*"

Because the framework that you install is 5.0, it require PHP >= 5.4, PHP < 7 .因为您安装的框架是 5.0,所以它需要PHP >= 5.4, PHP < 7 See: https://laravel.com/docs/5.0#server-requirements请参阅: https://laravel.com/docs/5.0#server-requirements

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM