turn on locally register_globals on PHP5?

shortfork

Well-Known Member
Sep 4, 2006
63
0
156
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
 

shortfork

Well-Known Member
Sep 4, 2006
63
0
156
php_flag register_globals on
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, [email protected]###.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
 

viraj

Well-Known Member
Sep 28, 2006
209
2
168
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...
 

shortfork

Well-Known Member
Sep 4, 2006
63
0
156
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...
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
 

shortfork

Well-Known Member
Sep 4, 2006
63
0
156
Hi Shortz :)

The location of the PHP config file should be in : /home/username/public_html/php.ini
hummn... tried that.. still no joy...

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

Thanks,
Shortz
 

shortfork

Well-Known Member
Sep 4, 2006
63
0
156
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
 

shortfork

Well-Known Member
Sep 4, 2006
63
0
156
See this thread:
http://forums.cpanel.net/showthread.php?t=78985&highlight=suphp

Particularly cpanelmatt's instructions. Apparently you need to indicate the file path in the .htaccess file.
Oh WOW... now that was a handy link!! Thanks.. I'm going to copy it here with credit given to original author..

cpanelmatt said:
You cannot have php_flag or php_value in .htaccess files with SuPHP. Rather you will need to put "SuPHP_ConfigPath /path/to/php/ini" inside of the .htaccess and then create a php.ini with the desired values in it
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