Click to See Complete Forum and Search --> : getting "500 internal server error"


taqi786
08-04-2008, 04:13 PM
i have installed a meta search engine perl script
but it is giving me the same error again and again

it resides at the given address:
http://yamsearch.co.cc/cgi-bin/yam/cgsearch.cgi

cgisearch.cgi is CHMOD 755

(as given instruction in program )

even then i am getting error:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@yamsearch.co.cc and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


whereas i installed a testing cgi there it is running fine that resides at:

http://yamsearch.co.cc/cgi-bin/yam/cc.cgi


Could anybody give me any suggestions????

Nedals
08-04-2008, 08:29 PM
#!/usr/bin/perl

use strict; # should be there but you may not have it. so comment it out for now.

use CGI::Carp(qw/fatalsToBrowser/); # Add this line to display the error

Your program here

Sixtease
08-05-2008, 03:59 AM
It reminds me very much of the error message that Apache gives when it is not configured to allow CGI. When I was dealing with the issue, I followed this document (http://httpd.apache.org/docs/1.3/howto/cgi.html). I added these lines to the Apache global configuration file:
<Directory />
AllowOverride Options
AddHandler cgi-script cgi
</Directory>
Then I had to do the same for my local virtual host config file (in /etc/apache2/vhost.d/my_domain.conf):
<VirtualHost *:80>
ServerName www.domain.xx
DocumentRoot /var/www/domain.xx/www

<Directory "/var/www/domain.xx/www/">
# some options
AllowOverride Options
# other options
</Directory>

</VirtualHost>
Maybe you won't need configure it at the two places but that's what I had to do.

Then I add the line Options +ExecCGI to the .htaccess file in every directory where I want CGI scripts run. The howto I linked talks about other ways to have it run, too.

HTH

taqi786
08-05-2008, 06:10 AM
jst tell me where i have to override my these settings

My HOST provided me Cpanel X for my hosting package

it contains apache handlers (pic attached below)

it consist of two queries

1. HANDLER
2. EXTENSION


If am making some mistake or I have to do something else


my error log is showing me this:

[Tue Aug 5 05:29:38 2008] [error] [client 66.249.71.2] Premature end of script headers: /home/yam/public_html/cgi-bin/yam/cgsearch.cgi

Thanks NEDAL & SIXTEASE

Sixtease
08-05-2008, 06:16 AM
Sorry, no idea about Cpanel X. I was talking about the Apache configuration file, wherever it may reside on your system. I guess you'll do best to contact your admin and ask if CGI's are allowed and/or how to configure it...

taqi786
08-05-2008, 10:07 AM
When I add this to the script:

#!/usr/bin/perl -w
use strict;
use CGI::Carp qw/fatalsToBrowser/;

I got this error msg when i open the link http://yamsearch.co.cc/cgi-bin/yam/cgsearch.cgi :

Software error:

Can't modify reference constructor in undef operator at cgsearch.cgi line 54, near "$cgx89;"
Execution of cgsearch.cgi aborted due to compilation errors.


The 54 line code of this software is :

$links.=$_;$links.="</td></tr></table></center>";($cgx9 eq $cgx44)?($cgx9=$cgx83):($cgx9 eq $cgx83 and $cgx9=$cgx44);if($cgx69){unless($cgx65 % $cgx69){$links.=&interad($cgx6,$cgx21,$cgx52,$cgx19) unless($cgx65==$cgx11);}}}}else{$error_msg=$cgx64;}}$error_msg and ($error_msg=~s/\#\#keywords\#\#/$cgx52/g,$error_msg=~s/\#\#enckeywords\#\#/$cgx19/g,$_=$cgx28,s{.*?<show_error_msg>(.*?)<\/show_error_msg>.*?}{<show_error_msg>$1<\/show_error_msg>}gs||s{.*?\#\#error_msg\#\#.*?}{<show_error_msg>\#\#error_msg\#\#<\/show_error_msg>}gs,$cgx28=$_);$_=$cgx28;s{<show_(\w+)>(.*?)<\/show_(\w+)>}{${$1} ne "" and $2;}ges;s{\#\#(\w+)\#\#}{${$1}}g;print;print $cgx16;undef \&$cgx89;($cgx5 && ($cgx29 eq 'full')) and cgx25($cgx31,$cgx15,'>'.$cgx8.'/storage/'.$cgx55.$cgx85.'kw.dat',$kw_match);return "";}sub cgx29{my($cgx31,$cgx35,$cgx7,$cgx22,$cgx11,$cgx9,$cgx27,$cgx5,$cgx15,$cgx8,$cgx2,$cgx6,$cgx4,$cgx1,$ cgx19,$cgx48,$cgx42,$cgx32,$cgx41,$cgx38,$cgx25)=@_;my $cgx17=$cgx11.'/engs-'.$cgx7;my $cgx44=0.250;my $cgx45=0.025;my(%cgx17);my(@cgx7);my(%cgx25);my(%cgx42);my($cgx26,$cgx21,$cgx28,$cgx23,$cgx51,$cgx34 );my($cgxI,$cgx14,$cgx33,$cgx39,$cgx37);

I have attached the script (in txt file below)

now if u can help

Thanks for ur anticipation

Nedals
08-05-2008, 06:01 PM
One request...
At 'The 54 line code of this software is:'
Change the [quote] to [code]. It will fix the forum page width problem.

Was 'use strict;' in your original code or did you add it (as I suggested; thinking this code was written by you). If you added it, take it out.

The error may be caused by the variable $cgx89 being used to create a dynamic reference which is typically not allowed when using 'strict'.

Try it without the 'strict' (leave the use CGI::Carp as is) and your problem MAY be solved.
Just a guess. :)