Register long arrays

From DreamHost
Jump to: navigation, search

Overview

In DreamHost's installation of PHP 5.3, the register_long_arrays directive is not enabled. As a result, scripts that make use of the following array variables do not work as expected:

  • $HTTP_COOKIE_VARS
  • $HTTP_ENV_VARS
  • $HTTP_GET_VARS
  • $HTTP_POST_VARS
  • $HTTP_SERVER_VARS
  • $HTTP_SESSION_VARS
  • $HTTP_POST_FILES
Dh-kb-note-icon.fw.png Note: Register long arrays is deprecated as of PHP 5.3 and removed as of PHP 5.4. For more information, please visit the following page:


Important icon.png Important: It's highly recommended that you upgrade to the latest version of PHP as DreamHost will officially EOL PHP versions 5.3 and 5.4 on all hosting plans on January 26, 2016. Please visit the following pages to view information on how to update to the latest PHP version:

In PHP 6, neither the register_long_arrays directive nor the old $HTTP_*_VARS array variables will exist at all, so any script which still uses the old variables must be updated.

The following table lists alternative variables:

long_array name alternative
$HTTP_COOKIE_VARS $_COOKIE
$HTTP_ENV_VARS $_ENV
$HTTP_GET_VARS $_GET
$HTTP_POST_VARS $_POST
$HTTP_SERVER_VARS $_SERVER
$HTTP_SESSION_VARS $_SESSION
$HTTP_POST_FILES $_FILES

See also