Topic: 1.3 500 Internal Server Error

I installed the SVN version of 1.3, turned on SEF URL's and uploaded the .htaccess file and I am getting a 500 internal server error. Is this a known bug?

My server is configured properly for .htaccess and modrewrite because I am using Wordpress with no problems.

Any ideas?

Re: 1.3 500 Internal Server Error

Worked fine for me =/

Re: 1.3 500 Internal Server Error

If I remove htaccess it loads fine but with the wrong URL's now. If I upload htaccess I get the 500 Internal Server Error?

Any idea why this is happening?

4 (edited by elbekko 2006-11-04 21:52)

Re: 1.3 500 Internal Server Error

Maybe the download of the file got corrupted?
Here's the right one:

<IfModule mod_rewrite.c>

    RewriteEngine On

    RewriteRule ^change/email/([0-9]+)/?$ profile.php?action=change_email&id=$1 [L,NC]
    RewriteRule ^change/email/([0-9]+)/([a-zA-Z0-9]+)/?$ profile.php?action=change_email&id=$1&key=$2 [L,NC]
    RewriteRule ^change/password/([0-9]+)/?$ profile.php?action=change_pass&id=$1 [L,NC]
    RewriteRule ^change/password/([0-9]+)/([a-zA-Z0-9]+)/?$ profile.php?action=change_pass&id=$1&key=$2 [L,NC]
    RewriteRule ^delete/([0-9]+)/?$ delete.php?id=$1 [L,NC]
    RewriteRule ^delete/avatar/([0-9]+)/?$ profile.php?action=delete_avatar&id=$1 [L,NC]
    RewriteRule ^edit/([0-9]+)/?$ edit.php?id=$1 [L,NC]
    RewriteRule ^email/([0-9]+)/?$ misc.php?email=$1 [L,NC]
    RewriteRule ^forum/([0-9]+)/?$ viewforum.php?id=$1 [L,NC]
    RewriteRule ^forum/([0-9]+)/page/([0-9]+)/?$ viewforum.php?id=$1&p=$2 [L,NC]
    RewriteRule ^forum/([0-9]+)/rss/?$ extern.php?action=feed&fid=$1&type=rss [L,NC]
    RewriteRule ^forum/([0-9]+)/atom/?$ extern.php?action=feed&fid=$1&type=atom [L,NC]
    RewriteRule ^help/?$ help.php [L,NC]
    RewriteRule ^login/?$ login.php [L,NC]
    RewriteRule ^logout/([0-9]+)/?$ login.php?action=out&id=$1 [L,NC]
    RewriteRule ^mark/read/?$ misc.php?action=markread [L,NC]
    RewriteRule ^new/topic/([0-9]+)/?$ post.php?fid=$1 [L,NC]
    RewriteRule ^new/reply/([0-9]+)/?$ post.php?tid=$1 [L,NC]
    RewriteRule ^new/reply/([0-9]+)/quote/([0-9]+)/?$ post.php?tid=$1&qid=$2 [L,NC]
    RewriteRule ^post/([0-9]+)/?$ viewtopic.php?pid=$1 [L,NC]
    RewriteRule ^post/([0-9]+)/?\#p([0-9]+)$ viewtopic.php?pid=$1#p$2 [L,NC]
    RewriteRule ^register/?$ register.php [L,NC]
    RewriteRule ^report/([0-9]+)/?$ misc.php?report=$1 [L,NC]
    RewriteRule ^request/password/?$ login.php?action=forget [L,NC]
    RewriteRule ^rules/?$ misc.php?action=rules [L,NC]
    RewriteRule ^search/?$ search.php [L,NC]
    RewriteRule ^search/([0-9]+)/?$ search.php?search_id=$1 [L,NC]
    RewriteRule ^search/([0-9]+)/page/([0-9]+)/?$ search.php?search_id=$1&p=$2 [L,NC]
    RewriteRule ^search/new/?$ search.php?action=show_new [L,NC]
    RewriteRule ^search/recent/?$ search.php?action=show_24h [L,NC]
    RewriteRule ^search/unanswered/?$ search.php?action=show_unanswered [L,NC]
    RewriteRule ^search/subscriptions/?$ search.php?action=show_subscriptions [L,NC]
    RewriteRule ^search/user/([0-9]+)/?$ search.php?action=show_user&user_id=$1 [L,NC]
    RewriteRule ^subscribe/([0-9]+)/?$ misc.php?subscribe=$1 [L,NC]
    RewriteRule ^topic/([0-9]+)/?$ viewtopic.php?id=$1 [L,NC]
    RewriteRule ^topic/([0-9]+)/page/([0-9]+)/?$ viewtopic.php?id=$1&p=$2 [L,NC]
    RewriteRule ^topic/([0-9]+)/new/posts/?$ viewtopic.php?id=$1&action=new [L,NC]
    RewriteRule ^topic/([0-9]+)/last/post/?$ viewtopic.php?id=$1&action=last [L,NC]
    RewriteRule ^topic/([0-9]+)/rss/?$ extern.php?action=feed&tid=$1&type=rss [L,NC]
    RewriteRule ^topic/([0-9]+)/atom/?$ extern.php?action=feed&tid=$1&type=atom [L,NC]
    RewriteRule ^unsubscribe/([0-9]+)/?$ misc.php?unsubscribe=$1 [L,NC]
    RewriteRule ^upload/avatar/([0-9]+)/?$ profile.php?action=upload_avatar&id=$1 [L,NC]
    RewriteRule ^user/([0-9]+)/?$ profile.php?id=$1 [L,NC]
    RewriteRule ^user/([0-9]+)/identity/?$ profile.php?section=identity&id=$1 [L,NC]
    RewriteRule ^user/([0-9]+)/setup/?$ profile.php?section=setup&id=$1 [L,NC]
    RewriteRule ^user/([0-9]+)/messaging/?$ profile.php?section=messaging&id=$1 [L,NC]
    RewriteRule ^user/([0-9]+)/signature/?$ profile.php?section=signature&id=$1 [L,NC]
    RewriteRule ^user/([0-9]+)/avatar/?$ profile.php?section=avatar&id=$1 [L,NC]
    RewriteRule ^user/([0-9]+)/display/?$ profile.php?section=display&id=$1 [L,NC]
    RewriteRule ^user/([0-9]+)/admin/?$ profile.php?section=admin&id=$1 [L,NC]
    RewriteRule ^users/?$ userlist.php [L,NC]
    RewriteRule ^users/([0-9\-]+)/([a-z_]+)/([a-zA-Z]+)/(.*?)/page/([0-9]+)/?$ userlist.php?show_group=$1&sort_by=$2&sort_dir=$3&username=$4&p=$5 [L,NC]

</IfModule>

EDIT: I see the update added some extras for the admin inteface:

Isolated the admin interface in it's own folder and added the admin scripts to the SEF URL scheme.

Maybe that's giving a problem with you; the code I posted above is still quite old but works tongue

Re: 1.3 500 Internal Server Error

Yeah I tried that and still no luck. I re-installed it and now I am getting this message when trying to change options. I am using it in a sub-domain but I can't see how that would be the problem.

Bad HTTP_REFERER. You were referred to this page from an unauthorized source. If the problem persists please make sure that 'Base URL' is correctly set in Admin/Options and that you are visiting the forum by navigating to that URL. More information regarding the referrer check can be found in the PunBB documentation.

Re: 1.3 500 Internal Server Error

Are you still having the internal server error problem or just the HTTP_REFERER problem? The latter you can ignore since we will most likely get rid of the referrer check completely in 1.3.

If you're having the internal server error, do you get anything in Apache's error_log?

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: 1.3 500 Internal Server Error

Well I uninstalled 1.3 and put up 1.2.14.

I was going to try and use 1.3 in a live environment but was advised against it.

I did repeatedly get the internal server error though with 1.3 and SEF urls on, and I did not check Apache's error log. If you like I can set it up again and let you know the details.

Re: 1.3 500 Internal Server Error

Could you check your error_log now? I mean, unless you've cleared it since you ran 1.3.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: 1.3 500 Internal Server Error

The error log wasn't turned on before, that's why I can't give it to you.

Re: 1.3 500 Internal Server Error

Ok. Would be kind of interesting to know what the problem was though. So if it's not too much trouble, maybe you could install 1.3 somewhere and try again?

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: 1.3 500 Internal Server Error

Yeah no problem. I will post back in a little bit.

Re: 1.3 500 Internal Server Error

Here you go Rickard:

[Sun Nov 5 16:33:16 2006] [alert] [client **.**.186.71] /myhost/punbb.***.com/.htaccess: RewriteRule: cannot compile regular expression '^users/([0-9\\-]+)/([a-z_]+)/([a-zA-Z]+)/(.*?)/page/([0-9]+)/?$'\n

I substituted some *** for the IP address and domain name, but that information shouldn't matter.

Re: 1.3 500 Internal Server Error

Hmm, interesting. I wonder what it doesn't like about that regex. Do you have any idea what version of Apache and/or mod_rewrite you're running?

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: 1.3 500 Internal Server Error

Apache/1.3.37 (Unix) mod_fastcgi/2.4.2 mod_perl/1.29 PHP/4.4.4 mod_throttle/3.1.2 FrontPage/5.0.2.2635 mod_psoft_traffic/0.1 mod_ssl/2.8.28 OpenSSL/0.9.7a

Re: 1.3 500 Internal Server Error

Rickard, do you need beta (or alpha) testing of 1.3? I was under the impression 1.3 was not ready for it, but if you need some testing, I ? and I'm sure a lot others ? can help with that.

Re: 1.3 500 Internal Server Error

I don't think Rickard is officially accepting bug reports for 1.3 yet. I'd wait until the official beta when extension hooks and all kinds of other fun things are ready to be tested wink

Re: 1.3 500 Internal Server Error

As soon as Trac is up and running again, we'll enable the bug tracker. That should do it.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

18 (edited by Jérémie 2006-11-16 02:39)

Re: 1.3 500 Internal Server Error

It seems Smartys was interested, so with r626 I have the same thing. HTTP 500 that goes away if I comment out that RewriteRule. I'm under Apache 1.3.37

19 (edited by Jérémie 2006-11-17 14:52)

Re: 1.3 500 Internal Server Error

Ok, I may have found it (well, someone on my host ML did would be more appropriate tongue )

RewriteRule ^users/(<0-9\->+)/(<a-z_>+)/(<a-zA-Z>+)/(.*)/page/(<0-9>+)/*$ userlist.php?show_group=$1&sort_by=$2&sort_dir=$3&username=$4&p=$5 [L,NC]

No HTTP500.

Could some rewrite guru check it, and see if that still does the trick?

The way I understood it, ? in regexp are for PCRE only, and Apache rewrite are posix regexp.

Re: 1.3 500 Internal Server Error

It might be because of ".*?", try:

^users/([-0-9]+)/([a-z_]+)/([a-zA-Z]+)/(.+)/page/([0-9]+)/?$

Re: 1.3 500 Internal Server Error

With /?* at the end (instead of my proposal of /*$) no HTTP500 either. It seems to work the same.

But either way, it doesn't rewrite the URL. If I go to userlist I am in /users/, but if I decide to filter the list with some criteria I'm moved to /userlist.php?username=&show_group=2&sort_by=registered&sort_dir=DESC&search=Submit for example.

I don't know if it's a code issue (no rewrite yet done on this, the rewriterule in .htaccess is justa placeholder) or a .htaccess rewrite bug (as far as I know it's the former, it's PHP code task to generate a "clean" URL).

I have however other issues with the clean URL, for example /search/ gives me a "No input file specified." error, as well as all admin's sub menu (/admin/*/)

I'll wait for the ticket system opening to report it.

Re: 1.3 500 Internal Server Error

I don't think /admin/ is meant to work yet, moving the admin files to their own folder was simply a first step
Now, as for userlist.php, I don't think the userlist search is meant to work yet either
However, you can build your own properly rewritten URL from the rule and make sure it gives you the right page smile

Re: 1.3 500 Internal Server Error

Well, then if swapping .*? by .* or .+ does the trick, no more bug in that area for know, only features wink