简体   繁体   中英

MAMP: How can I force a php version?

I recently updated my MAMP version to version 4 and I am given two versions of php that I can run. 7.0.13 or 7.1.0

I would like to run version 7.0.13, but whenever I choose that version, MAMP decides for me that I want 7.1.0

How can I "force" MAMP to use 7.0.13?

I am getting an error on an application that was working prior to upgrading: "Mcrypt is required." I am guessing that's because I am running 7.1.0?

This is what I see in my phpinfo file:

--with-mcrypt=shared,

I use this in my .bash_profile file to tell my system to use MAMP's version of php:

# Use MAMP version of PHP
PHP_VERSION=`ls /Applications/MAMP/bin/php/ | sort -n | tail -1`
export PATH=/Applications/MAMP/bin/php/${PHP_VERSION}/bin:$PATH

在此处输入图片说明

I had the same problem and found some suggestions for editing the bash_profile and whatnot, but in the end I just renamed the 7.1.0 folder in MAMP>bin>php and just added a dot in front of it.

Now MAMP defaults to 7.0.13 :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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