1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-23 15:22:41 +01:00
phorge-phorge/src
epriestley 72a03dc03e Add a setup warning for "always_populate_raw_post_data"
Summary:
Fixes T9235. When the stars align, PHP 5.6 or newer emits a deprecation warning on startup about "always_populate_raw_post_data" which occurs too early for us to intercept and can break responses by adding garbage to the output.

These settings appear to be sufficient:

```
always_populate_raw_post_data = 1
display_errors = 1
display_startup_errors = 1
error_reporting = -1
```

Then make a request with an unusual content type:

```
$ curl -X POST -H "Content-Type: application/json" -d "{foo: bar}" http://phabricator.example.com/
```

This triggers the warning:

```
<br />
<b>Deprecated</b>:  Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in <b>Unknown</b> on line <b>0</b><br />
<br />
...
```

To avoid this, just instruct administrators to set this value to "-1", which completely disables the feature and silences the warning.

Test Plan:
  - Reproduced this issue by following the instructions above.
  - Triggered the setup issue locally and read all the captivating prose:

{F1786911}

  - Made the configuration change it directed me to, saw the setup issue resolve.

Reviewers: jcox

Reviewed By: jcox

Maniphest Tasks: T9235

Differential Revision: https://secure.phabricator.com/D16454
2016-08-26 07:38:08 -07:00
..
__tests__ Use PhutilClassMapQuery instead of PhutilSymbolLoader 2015-08-14 07:49:01 +10:00
aphront Convert some whiny exceptions into quiet MalformedRequest exceptions 2016-08-16 15:50:21 -07:00
applications Add a setup warning for "always_populate_raw_post_data" 2016-08-26 07:38:08 -07:00
docs Updated the docs so chatbots can use the Conduit API 2016-08-24 19:05:30 -04:00
extensions Add src/extensions/ to Phabricator 2013-08-14 15:38:06 -07:00
infrastructure Updated the docs so chatbots can use the Conduit API 2016-08-24 19:05:30 -04:00
view Removing deprecated method calls 2016-08-23 03:26:34 -05:00
__phutil_library_init__.php Delete license headers from files 2012-11-05 11:16:51 -08:00
__phutil_library_map__.php Provide a new "hint" table for weird commits (rewritten, unreadable) 2016-08-24 09:31:46 -07:00