Search code examples
mampyii2mcryptmamp-pro

Problems running init as part of yii 2 install


I am installing yii 2 on a mac. I have mamp pro (3.0.7.3 latest) when i go to the command line and run.

php init i get a message saying

The mcrypt PHP extension is required by Yii2.

I checked the server using phpinfo() and it shows mcypt enabled. I checked the php.ini and it is listed and the file exists in the referenced directory.

any ideas anyone ??


Solution

  • This probably means that your php CLI (Command Line Interface) does not use the same php.ini than MAMP. You could use something like php -c /path/to/mamp/php.ini to be sure to use the same php.ini.

    Or try the following command : php --ini, this will show you configuration file names, e.g. :

    Configuration File (php.ini) Path: /path/to/php/conf
    Loaded Configuration File: (none)
    

    You could then make a symbolic link :

    cd /path/to/php/conf
    sudo ln -s /path/to/mamp/php.ini php.ini