SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Nov 2004
    Location
    The office. Always.
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Stubborn register_globals

    Hello,

    I've been wrestling with a couple apache/php installations on a couple of linux boxes and have been consistently running in to the same odd problem. I'm sure it's some ridiculous detail that is entirely my fault for tinkering with, but if someone could point me at some common pitfalls I'd appreciate it.

    Ok, so the problem...

    I can't convince register_globals to turn on. Please don't start out all replies by telling me how insecure it is to have it on

    At any rate, I've tried turning it on in the php.ini file, I've tried using the .htaccess file, and since I'm configuring for an installation of gforge, adding ini_set("register_globals", "1"); in every .php file will probably drive me insane. Anyone have any suggestions or things I've missed?

    I've been using phpinfo() to check the configuration of things, and so far only adding the ini_set calls has actually changed the "Local Value" of register_globals. the "Master Value" seems to correspond to my php.ini file.

    Thanks greatly for any information anyone can share.

    -Jeff

  2. #2
    SitePoint Guru
    Join Date
    Jul 2004
    Location
    Raleigh, NC
    Posts
    783
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    php.ini should be the only place you have to do it. also, this shouldn't work at all:
    ini_set("register_globals", "1");
    this isn't supposed to work for values set before script processing begins like register_globals is

  3. #3
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    register_globals is PHP_INI_PERDIR|PHP_INI_SYSTEM, so you can set in .htaccess as well:

    Code:
    php_flag register_globals on
    Alternatively, you can write

    PHP Code:
    extract($_REQUEST); 
    at the top of every script to simulate register_globals behaviour.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •