I have been using WAMP for testing a web app including phpmyadmin to view my databases. I’ve made no changes whatsoever to my environment since the last time I was working and suddenly I am getting some sort of fatal warning when I try to load phpmyadmin. The exact text is:
( ! ) Warning: Unsupported declare 'strict_types' in C:wamp64appsphpmyadmin5.0.2index.php on line 8
( ! ) Warning: Unsupported declare 'strict_types' in C:wamp64appsphpmyadmin5.0.2librariescommon.inc.php on line 33
PHP 7.1.3+ is required.
Currently installed version is: 5.6.40
I’m not sure why the version would be an issue, I’ve been using this version the entire time I’ve been doing this project and it’s been fine. Upgrading to php7 is not an option either as I’m working on a legacy system (will be migrating to 7 after this project).
What might this issue be? AFAIK I haven’t changed any settings or versions or anything like that and I’ve already tried restarting WAMP.
2
Answers
I believe WAMP ships with multiple PHP versions, is it possible you had been using PHP 7 and have since changed to PHP 5 (which I think is done with the system tray icon)?
It appears as if the latest WAMP, version 3.0.0, now ships with phpMyAdmin 5.0.2. However, phpMyAdmin 5.0.2 is not compatible with older PHP versions like your PHP 5.6, it requires at least 7.1.
This seems like it might be a WAMP packaging inconsistency, where they want to provide access to the older PHP 5.6, but also want you to have the new features of phpMyAdmin 5.x; but since the WAMP default is PHP 7 it may have been overlooked that phpMyAdmin isn’t compatible with the older option of PHP.
Your two possible solutions are to upgrade your PHP (which you’ve already said you don’t want to do) or downgrade phpMyAdmin — you can install your own phpMyAdmin 4.9.7 to the web root of your WAMP install, just give it a different name from the default WAMP phpMyAdmin so that there aren’t conflicts. Then you’ll ignore the WAMP–provided phpMyAdmin as it won’t work, and just access your own. You can download from https://www.phpmyadmin.net/downloads and uncompress it directly, or follow the guide at https://docs.phpmyadmin.net/en/latest/setup.html#quick-install.
This will tell PHPMyAdmin to load version 4.9.7 which is compatible with PHP5.x