Skip to content

Commit 753cc0e

Browse files
author
Safwan Khan
committed
MAGETWO-34667: [GITHUB] Installer cannot verify php version - PHP 5.5.16-1+deb.sury.org~precise+1
- Fixed the bug described.
1 parent 43e189a commit 753cc0e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

setup/src/Magento/Setup/Controller/Environment.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,13 @@ public function phpVersionAction()
6666
);
6767
}
6868
$multipleConstraints = $this->versionParser->parseConstraints($requiredVersion);
69-
$currentPhpVersion = $this->versionParser->parseConstraints(PHP_VERSION);
69+
try {
70+
$normalizedPhpVersion = $this->versionParser->normalize(PHP_VERSION);
71+
} catch (\UnexpectedValueException $e) {
72+
$prettyVersion = preg_replace('#^([^~+-]+).*$#', '$1', PHP_VERSION);
73+
$normalizedPhpVersion = $this->versionParser->normalize($prettyVersion);
74+
}
75+
$currentPhpVersion = $this->versionParser->parseConstraints($normalizedPhpVersion);
7076
$responseType = ResponseTypeInterface::RESPONSE_TYPE_SUCCESS;
7177
if (!$multipleConstraints->matches($currentPhpVersion)) {
7278
$responseType = ResponseTypeInterface::RESPONSE_TYPE_ERROR;

0 commit comments

Comments
 (0)