Skip to content

Commit 94fdef3

Browse files
committed
MAGETWO-44547: [php7] "PHP Settings Check" fail in Web Setup Wizard blocks installation via web
- fixed default configuration check
1 parent cd4e5b7 commit 94fdef3

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

setup/src/Magento/Setup/Model/PhpReadinessCheck.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -198,24 +198,23 @@ private function checkPopulateRawPostSetting()
198198

199199
$data = [];
200200
$error = false;
201-
$rawPostData = ini_get('always_populate_raw_post_data');
202-
$iniSetting = $rawPostData !== false ? intval($rawPostData) : null;
201+
$iniSetting = intVal(ini_get('always_populate_raw_post_data'));
203202

204203
if (version_compare(PHP_VERSION, '5.6.0') >= 0
205204
&& version_compare(PHP_VERSION, '7.0.0') < 0
206-
&& ($iniSetting !== -1 && $iniSetting !== null)
205+
&& $iniSetting !== -1
207206
) {
208207
$error = true;
209208
}
210209

211210
$message = sprintf(
212211
'Your PHP Version is %s, but always_populate_raw_post_data = %d.
213-
$HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and is removed from PHP 7.0 onwards.
214-
This will stop the installer from running.
215-
Please open your php.ini file and remove always_populate_raw_post_data.
216-
If you need more help please call your hosting provider.',
212+
$HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and will be removed in PHP 7.0.
213+
This will stop the installer from running.
214+
Please open your php.ini file and set always_populate_raw_post_data to -1.
215+
If you need more help please call your hosting provider.',
217216
PHP_VERSION,
218-
$iniSetting
217+
intVal(ini_get('always_populate_raw_post_data'))
219218
);
220219

221220
$data['always_populate_raw_post_data'] = [

setup/src/Magento/Setup/Test/Unit/Model/PhpReadinessCheckTest.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,10 @@ public function testCheckPhpSettings()
188188
);
189189
$rawPostMessage = sprintf(
190190
'Your PHP Version is %s, but always_populate_raw_post_data = -1.
191-
$HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and is removed from PHP 7.0 onwards.
192-
This will stop the installer from running.
193-
Please open your php.ini file and remove always_populate_raw_post_data.
194-
If you need more help please call your hosting provider.',
191+
$HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and will be removed in PHP 7.0.
192+
This will stop the installer from running.
193+
Please open your php.ini file and set always_populate_raw_post_data to -1.
194+
If you need more help please call your hosting provider.',
195195
PHP_VERSION
196196
);
197197
$expected = [
@@ -224,10 +224,10 @@ public function testCheckPhpSettingsFailed()
224224
);
225225
$rawPostMessage = sprintf(
226226
'Your PHP Version is %s, but always_populate_raw_post_data = -1.
227-
$HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and is removed from PHP 7.0 onwards.
228-
This will stop the installer from running.
229-
Please open your php.ini file and remove always_populate_raw_post_data.
230-
If you need more help please call your hosting provider.',
227+
$HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and will be removed in PHP 7.0.
228+
This will stop the installer from running.
229+
Please open your php.ini file and set always_populate_raw_post_data to -1.
230+
If you need more help please call your hosting provider.',
231231
PHP_VERSION
232232
);
233233
$expected = [
@@ -252,10 +252,10 @@ public function testCheckPhpSettingsNoXDebug()
252252
$this->phpInfo->expects($this->once())->method('getCurrent')->willReturn([]);
253253
$rawPostMessage = sprintf(
254254
'Your PHP Version is %s, but always_populate_raw_post_data = -1.
255-
$HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and is removed from PHP 7.0 onwards.
256-
This will stop the installer from running.
257-
Please open your php.ini file and remove always_populate_raw_post_data.
258-
If you need more help please call your hosting provider.',
255+
$HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and will be removed in PHP 7.0.
256+
This will stop the installer from running.
257+
Please open your php.ini file and set always_populate_raw_post_data to -1.
258+
If you need more help please call your hosting provider.',
259259
PHP_VERSION
260260
);
261261
$expected = [

0 commit comments

Comments
 (0)