Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: GameKiwi on November 28, 2005, 05:35:37 PM

Title: Internal Server Problem
Post by: GameKiwi on November 28, 2005, 05:35:37 PM
Hi All

I recently installed RC1.1 so I am not sure if this is what has caused the problem or not.

Anyway, if you go to www.gamekiwi.com/forum and try to click on Login or something in the main forum you get an internal Server Problem.  Now the problem is that for some reason it is putting in PHPSESSID= etc into the url.

If you press Ctrl F5 to force a refresh it disappears.

The question I have is, Help, how do I stop this from happening at all.

Thanks
Title: Re: Internal Server Problem
Post by: Fizzy on November 28, 2005, 05:50:09 PM
Hi

This sounds like a server issue.

Please have a look at Having problems with mod_security? (http://www.simplemachines.org/community/index.php?topic=34270.0) and hopefully your host should be able to help resolve it :)

Cheers

Fizz
Title: Re: Internal Server Problem
Post by: GameKiwi on November 28, 2005, 06:23:40 PM
well mod security isn't turned on so that isn't the problem.

any other ideas?
Title: Re: Internal Server Problem
Post by: Fizzy on November 29, 2005, 02:10:56 PM
Has something changed?

I just tried the link again and now the forum is loading properly even with the PHPSESSID=

If you found a fix for the problem please feel free to share it for future members :)

Cheers

Fizz
Title: Re: Internal Server Problem
Post by: Oldiesmann on November 29, 2005, 02:33:41 PM
I've seen this error numerous times. It's actually a bug in SMF, but only happens in certain situations depending on the PHP settings. If php is running in CGI mode and "session.use_trans_sid" is enabled in php.ini, SMF wants to put a ; after the PHPSESSID in the URL, and this causes problems for some reason. It seems that this has been fixed on your server, but here's the fix again for future reference:

There are two ways to fix this:

The first is to turn off the "session.use_trans_sid" option in php.ini by putting this at the beginning of index.php:

Code: [Select]
ini_set('session.use_trans_sid', 0);
That will make the server hide the session ID instead of displaying it in the URL for everyone to see (which can be a security risk in certain situations).

If that doesn't work for some reason, make the following change in Sources/QueryString.php

Find
Code: [Select]
$buffer = preg_replace('/"' . preg_quote($scripturl, '/') . '(?!\?' . preg_quote(SID, '/') . ')(\?)?/', '"' . $scripturl . '?' . SID . ';', $buffer);
Replace
Code: [Select]
$buffer = preg_replace('/"' . preg_quote($scripturl, '/') . '(?!\?' . preg_quote(SID, '/') . ')(\?)?/', '"' . $scripturl . '?' . SID . '&', $buffer);
This wouldn't be as much of an issue if hosts would stop enabling session.use_trans_sid and would stop running PHP in CGI mode :)
Title: Re: Internal Server Problem
Post by: GameKiwi on November 29, 2005, 02:37:47 PM
Yes it seems to be working fine now.  What I did to fix it though I don't really know.  Sorry :)
Title: Re: Internal Server Problem
Post by: Fizzy on November 29, 2005, 04:56:17 PM
Thanks for that Oldiesmann, that explains the extra ;
Title: Re: Internal Server Problem
Post by: King RoRo on December 06, 2005, 06:10:16 AM
Thanks for that Oldiesmann, that explains the extra ;


thanks .... thanks alot Oldiesmann.... u r my hero  ;)



God bless u
Title: Re: Internal Server Problem
Post by: nikon on December 09, 2005, 05:24:04 PM
thanks alot Oldiesmann :D

i´ll fix this bug now...
Title: Re: Internal Server Problem
Post by: middenface on April 13, 2007, 03:12:22 AM
I know this is an old topic, but I was having the same "404 permission denied" problem and whilst [Unknown]'s solution did not work, this one seems to have been a good fix.

Nice one Oldiesmann :D
Title: Re: Internal Server Problem
Post by: thegto on April 13, 2007, 03:52:57 AM
Hi I got a 500 internal server error, when I login/logout/ member post ..guest nothing happen

my smf is version 1.1.1

can I resolve following as Oldiesmann advise ?
Title: Re: Internal Server Problem
Post by: Sarge on April 13, 2007, 04:17:13 AM
can I resolve following as Oldiesmann advise ?

Give it a try. :)
Title: Re: Internal Server Problem
Post by: thegto on April 13, 2007, 11:43:31 AM
from Oldiesmann
I put in the begining of index.php
Code: [Select]
ini_set('session.use_trans_sid', 0);
code I can't find
but I found something like this instead..
Code: [Select]
$buffer = preg_replace('/"' . preg_quote($scripturl, '/') . '(?!\?' . preg_quote(SID, '/') . ')(\?)?/', '"' . $scripturl . '?' . SID . '&', $buffer);


and I replace which this one
Code: [Select]
$buffer = preg_replace('/"' . preg_quote($scripturl, '/') . '(?!\?' . preg_quote(SID, '/') . ')(\?)?/', '"' . $scripturl . '?' . SID . '&', $buffer);

I still got 500 internal error - this error I got when I login and logout and also when post something by using member id, webbrowser are loaded and stuck on the post page.

if I use guest post something, it work fine.

I use SMF1.1.1
Theme orange-IT ---> I change to default it still the same.
I install mod only  No Spam by Guests!
my webboard http://asian-movie.freehostia.com/webboard/index.php
if anyone'd like to test post
id : testmember
pass : test1234

please give me some advise ....  :'(
Thank you in advance
Title: Re: Internal Server Problem
Post by: Nica on July 02, 2008, 10:35:40 AM
I've seen this error numerous times. It's actually a bug in SMF, but only happens in certain situations depending on the PHP settings. If php is running in CGI mode and "session.use_trans_sid" is enabled in php.ini, SMF wants to put a ; after the PHPSESSID in the URL, and this causes problems for some reason. It seems that this has been fixed on your server, but here's the fix again for future reference:

There are two ways to fix this:

The first is to turn off the "session.use_trans_sid" option in php.ini by putting this at the beginning of index.php:

Code: [Select]
ini_set('session.use_trans_sid', 0);That will make the server hide the session ID instead of displaying it in the URL for everyone to see (which can be a security risk in certain situations).

If that doesn't work for some reason, make the following change in Sources/QueryString.php

Find
Code: [Select]
$buffer = preg_replace('/"' . preg_quote($scripturl, '/') . '(?!\?' . preg_quote(SID, '/') . ')(\?)?/', '"' . $scripturl . '?' . SID . ';', $buffer);
Replace
Code: [Select]
$buffer = preg_replace('/"' . preg_quote($scripturl, '/') . '(?!\?' . preg_quote(SID, '/') . ')(\?)?/', '"' . $scripturl . '?' . SID . '&', $buffer);
This wouldn't be as much of an issue if hosts would stop enabling session.use_trans_sid and would stop running PHP in CGI mode :)

I am wondering sir, if this solution might apply to my problem. I receive the following error message whenever I try to view attachments or downloads or view photos from he gallery ( which I have now uninstalled) and when I try to edit or delete a profile comment.

Not Acceptable

An appropriate representation of the requested resource /MomMe/index.php could not be found on this server.
Apache/2.2.8 (Unix) mod_ssl/2.2.8 OpenSSL/0.9.8b mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at mom-me-dearest.com Port 80

I tried disabling mod security via the .htaccess file. But the server apparently does not allow that as it cased the site not to load. I contacted the host and thus far received no help. They directed me back to SMF.

I know this is an old thread but I have made several posts on the community forum with mostly redirects to my host or to several tutorials that haven't helped yet. I don't mind reading them. I am learning a lot and finding it all interesting just not helpful as yet in this instance.

using: SMF 1.1.5 Default theme
Mods installed:
1.      Auto Embed Video/Audio Clips      3.0 
2.    Neat Board Layout    1.5    
3.    clickableImagebbcode    1.0    
4.    cbi, 1.0    1.0a    
5.    SMF 1.0.13 / 1.1.5 / 2.0 b3.1 Update    1.0    
6.    simplemp    2.1    
7.    Pm_Informer    1.0    
8.    Profile Music    1.0    
9.    Downloads System  1.0.4
All mods work fine except Downloads are not viewable, and profile comments not editable.

www.mom-me-dearest.com
Title: Re: Internal Server Problem
Post by: chilli on November 20, 2008, 09:01:28 AM
Wow!! Several years on from it's original posting and this thread STILL proves it's worth.

Such a small change with such big results. It worked perfectly for me - I'd never had this problem before so I guess it's just something wierd about my current hosts server settings.

Thank you so much Oldiesmann!!!