diff --git a/setup/pub/magento/setup/readiness-check.js b/setup/pub/magento/setup/readiness-check.js index ee51c0b5fa49d..6306b2cef9c65 100644 --- a/setup/pub/magento/setup/readiness-check.js +++ b/setup/pub/magento/setup/readiness-check.js @@ -32,6 +32,11 @@ angular.module('readiness-check', []) processed: false, expanded: false }; + $scope.rawpost = { + visible: false, + processed: false, + expanded: false + }; $scope.extensions = { visible: false, processed: false, @@ -57,6 +62,19 @@ angular.module('readiness-check', []) $scope.stopProgress(); } }, + 'php-rawpost': { + url:'index.php/environment/php-rawpost', + show: function() { + $scope.startProgress(); + $scope.rawpost.visible = true; + }, + process: function(data) { + $scope.rawpost.processed = true; + angular.extend($scope.rawpost, data); + $scope.updateOnProcessed($scope.rawpost.responseType); + $scope.stopProgress(); + } + }, 'php-extensions': { url:'index.php/environment/php-extensions', show: function() { diff --git a/setup/src/Magento/Setup/Controller/Environment.php b/setup/src/Magento/Setup/Controller/Environment.php index d5b43f85d0a52..8c2bd5ab021b7 100644 --- a/setup/src/Magento/Setup/Controller/Environment.php +++ b/setup/src/Magento/Setup/Controller/Environment.php @@ -81,6 +81,29 @@ public function phpVersionAction() return new JsonModel($data); } + /** + * Checks if PHP version >= 5.6.0 and always_populate_raw_post_data is set + * + * @return JsonModel + */ + public function phpRawpostAction() + { + $iniSetting = ini_get('always_populate_raw_post_data'); + $responseType = ResponseTypeInterface::RESPONSE_TYPE_SUCCESS; + if (version_compare(PHP_VERSION, '5.6.0') >= 0 && (int)$iniSetting > -1) { + $responseType = ResponseTypeInterface::RESPONSE_TYPE_ERROR; + } + $data = [ + 'responseType' => $responseType, + 'data' => [ + 'version' => PHP_VERSION, + 'ini' => $iniSetting + ] + ]; + + return new JsonModel($data); + } + /** * Verifies php verifications * diff --git a/setup/view/magento/setup/readiness-check/progress.phtml b/setup/view/magento/setup/readiness-check/progress.phtml index 9625e59bb2094..2474e9386c90a 100644 --- a/setup/view/magento/setup/readiness-check/progress.phtml +++ b/setup/view/magento/setup/readiness-check/progress.phtml @@ -85,6 +85,59 @@ +
+ +

+ Checking PHP Version and PHP Raw Post Data Settings... +

+ +
+ +
+ + + +
+

PHP Raw Post Data Check

+

+ You are not populating raw_post_data or your PHP version is less than 5.6.0 +

+
+ +
+ +
+ +
+

Need Help?

+ PHP Documentation +
+ + + +
+

PHP Raw Post Data Check

+

+ Your PHP Version is {{rawpost.data.version}}
+ always_populate_raw_post_data = {{rawpost.data.ini}}. + + Show detail + Hide detail + +

+

+ $HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and will stop the installer from running, + please open your php.ini file and set always_populate_raw_post_data to -1 (uncomment if necessary) +

+

If you need more help please call your hosting provider.

+
+ +
+ +
+ +
+