ricster
ricster

Reputation: 521

MAMP phpMyAdmin is not active?

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?

Upvotes: 15

Views: 24582

Answers (7)

Ian
Ian

Reputation: 3326

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

Upvotes: 1

Antuann
Antuann

Reputation: 31

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

Upvotes: 3

Andreia Marques
Andreia Marques

Reputation: 11

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

Upvotes: 1

Jaime Paulo Lopes
Jaime Paulo Lopes

Reputation: 67

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

Upvotes: 7

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.

Upvotes: 4

Peyotle
Peyotle

Reputation: 2305

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.

Upvotes: 19

ricster
ricster

Reputation: 521

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.

Upvotes: 4

Related Questions