15

I've just installed the free version of MAMP and I can't access phpMyAdmin tool.

phpMyAdmin is not clickable and it says needs PHP 5.5.x to 7.0.x as it can be seen from the screenshot;

phpMyAdmin is not clickable

However, when I checked the installed PHP version;

ricsters-MacBook-Pro:~ ricster$ php -v
PHP 7.1.1 (cli) (built: Jan 23 2017 15:09:57) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies

So I have the PHP 7.1.1 installed but for some reason, MAMP doesn't recognize it. How can I solve this issue?

miken32
  • 42,008
  • 16
  • 111
  • 154
ricster
  • 521
  • 2
  • 5
  • 16

7 Answers7

19

You can choose another PHP version from Preferences -> PHP.

There is PHP 7.0.15 shipped with MAMP. Enable it and restart MAMP.

MAMP shows only two versions of PHP, so if you don't see it on the list then go to the folder

Applications/MAMP/bin/php

and rename folders with PHP versions you are not using.

Peyotle
  • 2,255
  • 1
  • 15
  • 16
7

Selecting 7.0.15 in the preferences worked for me, but also...

Just going to http://localhost/phpmyadmin/ opens phpMyAdmin on my MAMP install running 7.1.1

4

Okay, so I finally solved the problem. First as aynber mention above in the comment section, I needed to install another Php version, so with homebrew, I installed the PHP 7.0;

brew install php70

then to start;

brew services start homebrew/php/php70

and then;

export PATH="$(brew --prefix homebrew/php/php70)/bin:$PATH"

finally, I changed the folder name of the PHP 7.1.1 in MAMP folder to

/Applications/MAMP/bin/php/php7.1.1_notActive

after that restarted the MAMP and now I have access to phpMyAdmin.

ricster
  • 521
  • 2
  • 5
  • 16
  • 2
    There is no need to install another version of PHP with homebrew. Most probably, the main reason why it started to work is renaming the newer PHP folder inside your MAMP. – Peyotle Feb 20 '17 at 03:26
4

Open terminal. Then open with sudo this file /Applications/MAMP/bin/mamp/index.php in your favorite editor, for example:

sudo nano /Applications/MAMP/bin/mamp/index.php

Then find that text block (it occurs twice in the index.php, for the menu item and for the link):

<?php if(version_compare(PHP_VERSION, '5.5.0', '>=') and version_compare(PHP_VERSION, '7.1', '<') ): ?>

and remove last php version check like this:

<?php if(version_compare(PHP_VERSION, '5.5.0', '>=')): ?>

Save file and restart MAMP, not only Apache, but also MAMP control center.

Profit!

P.S.: for nano, you can find desired string with holding ctrl+w, paste if(version_compare(PHP_VERSION, '5.5.0' and pressing enter.

3

I tried another very simple way and it works!!

Go to MAMP Console ">Preferences >PHP", it is selected by default 7.1.1 version, I just selected the other version 7.0.15, click OK and restart servers, all links for PHPMyAdmin are available now..!! enter image description here

Antuann
  • 31
  • 1
1

When you open the webstart ( like this---> http://localhost:8888/MAMP/?language=English)

and go in "Tools" looking for the "PHPMyAdmin" and can't click on it, there will be in front of it the proper version that you need to connect.

So just read it and then go back to MAMP on the left side down you will see "Languages" click on "PHP" go to Default version and choose the right version click save and voila!!! :D

1

You'll need to change your PHP version for localhost to version 7.0.x. Fortunately Mamp Pro v. 4.x comes with v. 7.0.x already, you just have to switch localhost (or everthing) to use it.

Assuming you have Mamp Pro v 4.x.x to change it for all sites:

  1. Click on PHP under languages Step 1

  2. Change the Default PHP version or select Change the Individual PHP version for every host Step 2a Step 2b

  3. Restart Servers

  4. If you set the to individual versions of PHP per server, go back to localhost and update to version 7.0.x (if you didn't change the default version). Restart servers. Step 4
Ian
  • 3,266
  • 4
  • 29
  • 37