Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6320647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:00:44+00:00 2026-05-24T16:00:44+00:00

I recently updated to PHP 5.3.6 and there were some deprecated functions and INI

  • 0

I recently updated to PHP 5.3.6 and there were some deprecated functions and INI directives. I have the following function:

function ServerVar($varName) {
global $HTTP_SERVER_VARS;
global $HTTP_ENV_VARS;

if(!isset($_SERVER))
{
    $_SERVER = $HTTP_SERVER_VARS;
    if(!isset($_SERVER["REMOTE_ADDR"]))
        $_SERVER = $HTTP_ENV_VARS; // must be Apache
    }

if(isset($_SERVER[$varName]))
    return $_SERVER[$varName];
else
    return "";
}

Running that function caused an error in apache log:

<b>Deprecated</b>:  Directive 'register_long_arrays' is deprecated in PHP 5.3 and greater in <b>Unknown</b> on line <b>0</b><br />

I modfied the code like this:

if(!isset($_SERVER))
{
    $_SERVER = &$HTTP_SERVER_VARS;
    if(!isset($_SERVER["REMOTE_ADDR"]))
        $_SERVER = &$HTTP_ENV_VARS; // must be Apache
    }

if(isset($_SERVER[$varName]))
    return $_SERVER[$varName];
else
    return "";
}

however the the same error still appears in apache log. What is the best way to resolve this problem?

Thank you!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T16:00:44+00:00Added an answer on May 24, 2026 at 4:00 pm

    In PHP 5.3 (really, I think any version of PHP 5 or later any version of PHP newer than 4.1.0) you shouldn’t ever need to use $HTTP_SERVER_VARS or $HTTP_ENV_VARS. Just use $_SERVER. If that does not work, then your server needs to have it’s configuration fixed; not code workarounds like this induced.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently updated my model, added a BooleanField to it however when I
I've been doing some web development work in PHP recently which has led me
Ok. I recently made some updates to this website. http://annberingerart.com/index.php Upon making some minor
I recently found the following article: http://www.tsqltutorials.com/with-common-table-expressions.php The article doesn't list which version of
I have a Magento store running inside of a frameset. Paypal recently updated their
In my PHP code I have the following SQL statement: $query = UPDATE users
We recently updated our Tomcat web service. The only things we really updated were
I recently updated to the new version of XCode and the session start code
I recently updated my Eclipse (now running 20100218-1602), and I've found whenever I click
I recently updated an application from VS2003 to VS2008 and I knew I would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.