The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

turn on locally register_globals on PHP5?

Discussion in 'General Discussion' started by shortfork, Jun 2, 2008.

  1. shortfork

    shortfork Well-Known Member

    Joined:
    Sep 4, 2006
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    Anyone know how to turn on register_globals for one site only via .htaccess file with current build WHM and Apache/2.2.8 PHP 5.2.5 and sql 5.0.51a-community... pretty much all latest versions of what the server does to itself...

    Have one client on the box who needs time to change out his scripts to accomodate php5... don't want to turn it on globally, would love to just do it site-by-site basis..

    TIA!!

    Shortz
     
  2. TheHeartSmasher

    TheHeartSmasher Active Member

    Joined:
    Jul 14, 2006
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    php_flag register_globals on
     
  3. shortfork

    shortfork Well-Known Member

    Joined:
    Sep 4, 2006
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    Tried that.. pitches an internal server error...

    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, webmaster@###.org and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request
     
  4. viraj

    viraj Well-Known Member

    Joined:
    Sep 28, 2006
    Messages:
    209
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    If you have php SuExec enabled, create/edit php.ini file into your website's root folder & enable register globals from within that php.ini file.

    Incase you don't have php SuExec, then add the tag mentioned earlier in the domains's .htaccess or server's httpd.conf file...
     
  5. shortfork

    shortfork Well-Known Member

    Joined:
    Sep 4, 2006
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    Yea I do have SuExec on... so by root folder, you're talking /home/sitename/php.ini ??

    THANKS by the way for rapid response!

    Shortz
     
  6. viraj

    viraj Well-Known Member

    Joined:
    Sep 28, 2006
    Messages:
    209
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Hi Shortz :)

    The location of the PHP config file should be in : /home/username/public_html/php.ini
     
  7. shortfork

    shortfork Well-Known Member

    Joined:
    Sep 4, 2006
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    hummn... tried that.. still no joy...

    Who should own php.ini in this case? Site owner or root?

    Thanks,
    Shortz
     
  8. viraj

    viraj Well-Known Member

    Joined:
    Sep 28, 2006
    Messages:
    209
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Hi,

    The owner should be root:root or owner:eek:wner, any will do. Also, make sure that the permissions are 644 [-rw-r--r--]....
     
  9. shortfork

    shortfork Well-Known Member

    Joined:
    Sep 4, 2006
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    Thanks Viraj, still no joy..

    Tried putting it in /home/sitename/
    /home/sitename/public_html/
    /home/sitename/public_html/folderwherefileis/

    Still nada...

    Seems only way I can get register_globals on is to edit /usr/lib/php.ini change "Off" to "On" and thus, turn it on server wide..

    Not really sure I'm creating all that much of a security problem, since this is not really a shared box...

    And this particular site needs this functionality, at least, until scripts can be rewritten...

    I'd REALLY like to solve this, though, and get it working in only one site!!

    Shortz
     
  10. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
  11. shortfork

    shortfork Well-Known Member

    Joined:
    Sep 4, 2006
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    Oh WOW... now that was a handy link!! Thanks.. I'm going to copy it here with credit given to original author..

    Just for clairfication... I got confused and made my .htaccess line "SuPHP_ConfigPath /path/to/config.php/config.php"

    Actually naming the config file.. wrong! Just the path.. for us cPanelers.. you'd copy the php.ini file to say, your home/site# folder, modify it to your needs.. "register_globals On" for instance... then add the line to your .htaccess file as above... bingo! After trying myrad ways to get this to work.. this is the wholey grail!!

    THANKS TO ALL!! SUCCESS IS SWEET!

    Shortz
     
Loading...

Share This Page