Jump to content

.htaccess File Throwing 500 Error


Recommended Posts

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites
  • 1 year later...

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!

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...