Hello,

For some reason last week when I tried to login to my admin I was prompted with this message:

"Error 500 - Internal server error
An internal server error has occured!
Please try again later."

Has anyone else come across this issue with 1and1 hosting? If so I tried to read some other forums and say that some ppl deleted their .htaccess file. Would this help? If so could it cause any problems.

Any help or suggestion would be great!

Thanks,

Sean
www.dynamicclothing.net (site in question)

Comments

pcs305’s picture

Deleteing the .htaccess file is not the solution.

The first thing to try is to change RewriteBase statement in you .htaccess file.
#RewriteBase /drupal change to RewriteBase /

Here is a thread where this problem was hashed out and resolved.
http://drupal.org/node/187501

Hope it helps.

dynamicclothing’s picture

Thank you for the help on the suggestion I followed the link at the bottom of your post and at the bottom of that the solutions was there!!!

Put this in your .htaccess file:

"AddType x-mapp-php5 .php"

and ur done!

Thanks for the help :)

dan.crouthamel’s picture

This was the solution for me as well. If you are using 1and1 (Linux package), it will use PHP 4 by default. Adding the line above to your .htaccess file will tell Apache to use PHP 5.

andywang’s picture

I'm also using 1and1 (linux hosting package), and adding this line got rid of the 500 Server Error messages when enabling certain modules such as "Views".

Thanks!
Andrew

Swift Arrow’s picture

I just wrote in that I hadnt' gotten it... but between submitting it to preview, and getting the page back, it's fixed!!!!

My problems were solved by:

  • Adding at top of .htaccess:
     AddType x-mapp-php5 .php
    
  • Changing:
    RewriteEngine on
    to:
    RewriteEngine ON
  • I have Drupal in a subdirectory, so I did this:
    RewriteBase /drupal57
  • Everything else inside the rewrite section is commented out except:
      # Rewrite current-style URLs of the form 'index.php?q=x'.
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]
    

And that did it!!

I'm using 1&1's Basic Linux Package.

Good luck!!

YesCT’s picture

thanks for posting this! i just had to do this too!

Cathy Theys
YesTrainingAndEducation.com

kjv1611’s picture

I began getting this error after attempted install of CCK Module.

I then found this forum posting from this site:
http://pedroposada.com/blog/error-500-internal-server-error-1and1-hostin...

And tried everything I've seen in here...

Well, except for this portion:

 RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]

Any thoughts? Do I need to do that? If so, what exactly does all that do?

I'm using 1&1 Home Package
Using Drupal 6.4, and tried both the "stable" current download for 6.x, and later tried the dev download AFTER I had already gotten this error message.

I am only getting the error when attempting to view/edit modules. Everwhere else so far seems fine, though I've not tried but a couple other pages.

I just started using this drupal stuff last Saturday. Any help would be appreciated. If you give me any instructions, please assume I know absolutely nothing (if you don't mind). :0)

kjv1611’s picture

Got it again after attemped install of FCKeditor module.
Got rid of message again by deleting FCKeditor folder.

kjv1611’s picture

I think fixed - I had accidentally renamed the .htaccess file to htaccess

Swift Arrow’s picture

yes... that can cause some problems. I have to name it htaccess on my system, upload it and then rename it adding the dot.
Not just once have I been tearing my hair out because it has not been working!

gjperera’s picture

I'm glad I ran into this solution, it's been bugging me for a while, will try when I got home this afternoon!

Visit http://www.gilsmethod.com for the latest computer tutorials.

gjperera’s picture

The only thing is that I needed to increase the memory size in the PHP.ini file.
Thanks to everyone who posted all these solutions!

Visit http://www.gilsmethod.com for the latest computer tutorials.

kjv1611’s picture

BTW, I didn't look at it much yet, but just now glanced. The site you link to in your posts looks pretty neat so far. It's a great idea - something I've wanted to turn at least part of my site idea into (personal site - not church, of course), but just haven't gotten around to. If anything, it'll provide an example for me to look at! I'll have to bookmark it and look at it more later. :0)

keypetery’s picture

I've only gotten this far in this thread and the solutions have worked so far!

I was asked to take over admin duties on a site hosted on 1and1, and I'm not familiar with their package...but I'm getting to be.

The site I'm updating has no CMS at the moment, and I'm trying to implement Drupal. Also a newbie for Drupal 6, as I've used only 5 for my other sites.

1and1 presents many...challenges and issues not seen with the hosting services I use already.

Thanks again to the folks in this thread...and to the Drupal community!

kevstev01’s picture

Thanks for posting this solution. I am using SEO friendly URL's, so the rewrite rule change was not appropriate, but I did get my site working by adding the PHP5 interpreter setting AND uncommenting the ReWriteBase line to allow usage on my sub-domain due to using a sub-directory of my web space. I found that changing the case of the RewriteEngine ON line made no difference to me : YMMV

AddType x-mapp-php5 .php
RewriteBase /

michaellenahan’s picture

I just followed swiftarrow's directions and they worked for me.
This includes replacing the RewriteRule in .htaccess with swiftarrow's one:

  # RewriteRule ^ index.php [L]
  # 
  RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]
gigab’s picture

THANKS !!!

It works perfect!!

ˇh2nk’s picture

Your soulution works well.
Thanks

rperezGBT’s picture

hello, my error 500 comes out when i try to access site building-modules menu...I have inserted the line "AddType x-mapp-php5 .php " on top of the .htaccess file and nothing.

I am also using 1&1 hosting.

here is my .htacess file in case someone can help me...i'm quite desperated.

Thanks!

#
# Apache/PHP/Drupal settings:
#

#added by rod
AddType x-mapp-php5 .php 
php_value memory_limit 64M


# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template)$">
  Order allow,deny
</FilesMatch>

# Don't show directory listings for URLs which map to a directory.
Options -Indexes

# Follow symbolic links in this directory.
Options +FollowSymLinks

# Make Drupal handle any 404 errors.
ErrorDocument 404 /index.php

# Force simple error message for requests for non-existent favicon.ico.
<Files favicon.ico>
  ErrorDocument 404 "The requested file favicon.ico was not found.
</Files>

# Set the default handler.
DirectoryIndex index.php

# Override PHP settings. More in sites/default/settings.php
# but the following cannot be changed at runtime.

# PHP 4, Apache 1.
<IfModule mod_php4.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# PHP 4, Apache 2.
<IfModule sapi_apache2.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
  # Enable expirations.
  ExpiresActive On

  # Cache all files for 2 weeks after access (A).
  ExpiresDefault A1209600

  # Do not cache dynamically generated pages.
  ExpiresByType text/html A1
</IfModule>

# Various rewrite rules.
<IfModule mod_rewrite.c>
  RewriteEngine ON

  # If your site can be accessed both with and without the 'www.' prefix, you
  # can use one of the following settings to redirect users to your preferred
  # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
  #
  # To redirect all users to access the site WITH the 'www.' prefix,
  # (http://example.com/... will be redirected to http://www.example.com/...)
  # adapt and uncomment the following:
  # RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
  # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
  #
  # To redirect all users to access the site WITHOUT the 'www.' prefix,
  # (http://www.example.com/... will be redirected to http://example.com/...)
  # uncomment and adapt the following:
  # RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
  # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]

  # Modify the RewriteBase if you are using Drupal in a subdirectory or in a
  # VirtualDocumentRoot and the rewrite rules are not working properly.
  # For example if your site is at http://example.com/drupal uncomment and
  # modify the following line:
    RewriteBase /drupal-6.6
  #
  # If your site is running in a VirtualDocumentRoot at http://example.com/,
  # uncomment the following line:
  # RewriteBase /

  # Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>

# $Id: .htaccess,v 1.90.2.1 2008/07/08 09:33:14 goba Exp $

------------------------------------------------------------
Rodrigo Pérez Rodríguez

Grupo de Bioingeniería y Telemedicina
Universidad Politécnica de Madrid
------------------------------------------------------------

kjv1611’s picture

Any hints of what causing in your log files?

Log files at:
http://yourwebsite.domain/admin/reports/status

You can also access the actual log file(s) somewhere within the Drupal installation as text files, but I can't remember where off the top of my head.

Also, are you sure there are no updates that needed to take place that haven't?

And are you using a default theme to get to the admin settings, or are you using a custom theme. If custom, see if you can change to a default theme, such as Garland, and then see if it works correctly.

plato1123’s picture

I think this problem is partially caused by poor php performance on 1and1 hosting. I notice that sometimes I can't get into the modules page, but if I hold down f5 in firefox on the 500 error page for a few seconds and then release, it loads almost every time. I get the feeling that something times out after 5 seconds under their default php4 configuration. Either their php5 server is faster or has a longer time-out.

BlueBrumie’s picture

I had a similar problem that when ever I added a new module, I would get a 500 internal server error when trying to access the access control page (only the access control link, I could access permissions via roles). The site in question is hosted by 1and1, so I added the 'AddType x-mapp-php5 .php' line to the .htaccess file and all worked fine.

rubab.11’s picture

i added 'AddType x-mapp-php5 .php' in htaccess file but still getting

Error 500 - Internal server error

An internal server error has occured!
Please try again later.

aqn’s picture

By all means try the various .htaccess, php.ini etc. fixes, but if all those fail to rectify your "500 internal server error" problem, here's another thing to check for: if your login ID has started too many processes already, new processes cannot be created and you may get the "500 internal server error".

To check how many process you have running, assuming you have shell access, run the following command on the shell command line:

ps axlwwf

The output looks like:

ps axlwwf
F UID PID PPID PRI NI VSZ RSS WCHAN STAT TTY TIME COMMAND
5 5289705 21014 20965 22 2 7760 1512 - SN ? 0:00 sshd: u35879284@pts/0
0 5289705 21020 21014 22 2 5728 1748 - SNs pts/0 0:00 \_ -bash
0 5289705 21043 21020 22 2 5388 1296 - SN pts/0 0:00 \_ /bin/sh /kunden/homepages/28/d94984537/htdocs/bin/keepalive 240
0 5289705 22105 21043 22 2 3852 464 - SN pts/0 0:00 | \_ sleep 240
0 5289705 22419 21020 22 2 4296 736 - RN+ pts/0 0:00 \_ ps axlwwf

This lists *all* the processes started by/owned by your UNIX ID. The UID is your numeric UNIX user ID. The PID is the ID of the process. The COMMAND column shows the currently running programs.

That will show all processes that you have started and are still running. You should not have more than a handful; anymore may be too many. To get rid of those that you know are not necessary, use the "kill" command:

kill

where is the ID of the process you want to kill. For example, to kill the "keepalive" process above, I'd do:

kill 21043

After doing the "kill", do another "ps axlwwf". If the process is still running, you can try a "forceful" kill:

kill -9 21043

(In my case, the "keepalive" background job starts every time I log in, but it keeps on running even when my login session was disconnected, resulting in a whole bunch of keepalive's processes running. After killing those processes, things return to normal.)

netourish’s picture

Thank you very much for posting this specially to "swiftarrow" your post did the thing for me, It was really helpful.

luciendub’s picture

Hello,
I got this problem and found a new way to resolve it. You need to add some lines to the .htaccess. But they are not the same as the ones you can find anywhere on web. Go on this page to get the "how to". http://error5001and1.luciendubois.net
Hope it helps!

fnikola’s picture

all other pages, including blog edit pages, are OK, but the view blog page returns the 500 error. i have url alias for blog entries and tried removing the url alias for specific blog entries, but still get the 500 error on the www.sample.com/node/999 page. the www.sample.com/node/999/edit page works fine.

fnikola’s picture

was due to another error on that specific page. i followed the below instructions to have this specific error print to the page. once i cleared up the error the page displayed fine.

To debug http 500 error put these lines at the very top of your index.php in your drupal installation:

ini_set("display_errors","1");
error_reporting(E_ALL);

Zalakain’s picture

Thanks fnikola! You're completely on target here! Adding that bit of code revealed what module was causing the issue in my case (fancy-login was it, that meant i couldn't login anymore....), so all that was left was to disable it manually (see http://drupal.org/node/157632) and hey presto! everything was fine again!
After having lost many hours browsing here and there, it was just your point which made my day! +1

fnikola’s picture

glad my experiences could help you ;)

soundboy89’s picture

fnikola wins!

Wow, thank you SO much. I've been struggling with this for hours and was getting desperate. I tried about 10 different changes and options on my .htaccess and nothing happened. I turned on error reporting following your advice and... turns out it had nothing to do with .htaccess but rather a fatal error caused by a function inside my custom theme. I had no idea a PHP error like that could manifest itself wearing an Error 500 disguise. Go figure.

vacho’s picture

This solution functioning for me.
Step 1:
Add the following to your .htaccess file:
##
AddType x-mapp-php5 .php
AddHandler x-mapp-php5 .php
##
Step 2:
Uncomment this line in your .htaccess file (the comments above this line explain its purpose):
# RewriteBase /

http://www.logicia.co.uk/blog/2011/08/drupal-error-500-on-1and1-hosting/

sanou01’s picture

thank you very much for good help