Ampps Logo

Installing pimcore via ampps returns PHP Version error

posted in: Technology | 0

If you use ampps for a local dev stack or for production, you may run into errors while trying to install pimcore:

Required PHP version less than 7.2.0 AND found version is : 7.3.11

Apparently softaculous isn’t quite smart enough to know that 7.3.11 is newer than the minimum requirement of 7.2.0…

How to resolve it

  1. Browse to your softaculous hooks folder within Ampps.
    Example: C:\Ampps\ampps\softaculous\enduser\hooks
  2. You should see pre_install.txt
  3. change the file extension to php by renaming it to pre_install.php
  4. add the PHP version code or you can replace function __pre_install with the following code:
function __pre_install(){	
	global $soft, $software, $globals;
	// Do stuff here e.g. is as follows
	if($soft == 26){ /* Do things only if its WordPress */	}
	$version = phpversion();
	define('php_version', $version);

5. Save it and re-try your install in Ampps