sigmadog Posted January 20, 2010 Posted January 20, 2010 I need to turn register_globals off in my .htaccess file in order to load Drupal 6. I just did this for another site and it worked fine, but it's not working on my current site. This is what I have in my .htaccess file: >php_flag register_globals off That's it. But I'm getting the following error log message: >Invalid command 'php_flag', perhaps misspelled or defined by a module not included in the server configuration I'm stumped why one .htaccess file works and a copy of it does not on different sites. Quote
sigmadog Posted January 20, 2010 Author Posted January 20, 2010 Also, I can't modify or even see the .htaccess files in File Manager. Is there some way to make it visible? Quote
TCH-Thomas Posted January 20, 2010 Posted January 20, 2010 That seems to bethe correct line to include in a htaccess file. Maybe you have something in the htaccess or on your account that interfere with that line? I would open a ticket with the help desk and ask them to check it. As for how to see the htaccess file in file manager... When you open file manager there should be a option "Show Hidden Files (dotfiles)". Check that and it should work. Quote
sigmadog Posted January 20, 2010 Author Posted January 20, 2010 That seems to bethe correct line to include in a htaccess file. Maybe you have something in the htaccess or on your account that interfere with that line? I would open a ticket with the help desk and ask them to check it. As for how to see the htaccess file in file manager... When you open file manager there should be a option "Show Hidden Files (dotfiles)". Check that and it should work. Thanks, Thomas. I opened a support ticket and it appears that my server "Denver" uses something called a "suPHP" configuration. I have no clue what that is, but the support guy said he modified the php.ini file to turn register_globals off, and everything appears to be in order now. My concern is whether the suPHP setup causes server errors with ALL .htaccess files, or JUST those with php commands, because I expect that I will be wanting to use .htaccess for a few things down the road. I've asked technical support about this in a follow-up email and am waiting to hear back. As for the file manager not showing hidden files, I'm not getting that option window anymore. Is there anyway to get it back so I can check the "show hidden files" box? Thanks for your help. Quote
TCH-Thomas Posted January 20, 2010 Posted January 20, 2010 Is there anyway to get it back so I can check the "show hidden files" box? Yes, at the bottom of cpanel there is a "reset all interface settings" option that will bring the box back. Quote
sigmadog Posted January 20, 2010 Author Posted January 20, 2010 Yes, at the bottom of cpanel there is a "reset all interface settings" option that will bring the box back. Thanks! Stupid me - I was looking at the top and totally ignored the bottom. Quote
OJB Posted January 20, 2010 Posted January 20, 2010 in response to your question about suPHP you are correct any PHP flags will not work within the htaccess and would probably result in a 500 server error. All PHP flags must be set in the php.ini file, but as you are on shared hosting you will be unable to do this. At least that is my understanding of suPHP. I may be wrong, let us know what tech support say. Quote
sigmadog Posted January 20, 2010 Author Posted January 20, 2010 All PHP flags must be set in the php.ini file, but as you are on shared hosting you will be unable to do this. That's what I thought, too, but then I got this from tech support: I have created a php.ini file where you can add these values and I have added the entry to turn register global off for you. But I was unable to locate a php.ini file and subsequent problems forced me to load Drupal via the Fantastico tool in cPanel. In the process of doing so, it appears that register_globals is once again enabled. So I've replied to tech support to fix it once again, and I also asked for clarification regarding my access to php.ini. On a minor note, I wish the emails sent from tech support where more clear - grammar mistakes abound and that makes them hard to interpret at times. Quote
TCH-Bruce Posted January 20, 2010 Posted January 20, 2010 The php.ini file was probably in your Drupal folder. Create a php.ini file in the Drupal folder and enter the command as such to turn register_globals off. >register_globals = Off Quote
OJB Posted January 20, 2010 Posted January 20, 2010 I thought php.ini files were set for an entire apache install and shared over all the vhosts at compile time not runtime? Or have I missed a trick here? Quote
sigmadog Posted January 20, 2010 Author Posted January 20, 2010 I thought php.ini files were set for an entire apache install and shared over all the vhosts at compile time not runtime? Or have I missed a trick here? I think this may be a capability of "suPHP", though I'm only speculating. Here's the suPHP site. Quote
TCH-Bruce Posted January 20, 2010 Posted January 20, 2010 The above is correct. This is a capability of suPHP. It basically moves the php set directives out of the .htaccess file and into it's own file. Quote
rockyrock Posted November 9, 2011 Posted November 9, 2011 get the same error message. The error log says the following: /public_html/lists/.htaccess: Invalid command 'php_flag', perhaps mis-spelled or defined by a module not included in the server configuration edit: put a # in front of "php_flag magic_quotes_gpc on" and it worx like a charm! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.