|
|
|
||||
|
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() |
|
|||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
|
Thread Tools |
|
|
#1 |
|
Confirmed User
Join Date: Jun 2003
Posts: 1,697
|
Any Perl expert ?
I am running a script and I get an internal server error.
No diagnostic. I know only very little of Perl language. I can't find out what the problem is here. Anyone can tell me what is wrong with this script? ########################################### #!/usr/bin/perl use CGI::Carp qw(fatalsToBrowser); use diagnostics; use CGI; use HTTP::Request::Common qw(POST); use LWP::UserAgent; $q = CGI->new(); $ua = LWP::UserAgent->new(); $req = POST 'http://maxmind.com:8010/b', [ l => "hgfjgfdhhh", i => "69.70.92.38", ]; $k = new CGI($res->content()); $region = $k->param( region ); $city = $k->param( city ); $country = $k->param( country ); print "Content-type: text/html\n\n"; print "$region\n"; exit; ###################################### Thanks ! |
|
|
|
|
|
#2 |
|
Confirmed User
Industry Role:
Join Date: Jan 2002
Posts: 7,981
|
i => "69.70.92.38",
Should not be a comma after the last one. That's the only thing I see right now. If that doesn't work, check the message in Apache's error log. |
|
|
|
|
|
#3 | |
|
Confirmed User
Join Date: Jun 2003
Posts: 1,697
|
Quote:
I corrected this misstake but it still doesn't work. I just asked webair to let me see my Apache's error log. |
|
|
|
|
|
|
#4 | |
|
Confirmed User
Join Date: Oct 2005
Posts: 199
|
Quote:
CGI::Carp qw/fatalsToBrowser/ would catch this. OP is correct to check apache logs.
__________________
i sale executive summaries of threads |
|
|
|
|
|
|
#5 |
|
Confirmed User
Join Date: Oct 2005
Posts: 199
|
BTW, dude, don't print "Content-type....."
just do print $k->header();
__________________
i sale executive summaries of threads |
|
|
|
|
|
#6 |
|
Confirmed User
Join Date: Dec 2001
Location: Malibu
Posts: 3,817
|
try this
Code:
#!/usr/bin/perl use CGI::Carp qw(fatalsToBrowser); use CGI; use HTTP::Request::Common qw(POST); use LWP::UserAgent; $q = CGI->new(); $ua = LWP::UserAgent->new(); $req = POST 'http://maxmind.com:8010/b', [l => "hgfjgfdhhh", i => "69.70.92.38" ]; $k = new CGI($ua->request($req)->content); $region = $k->param( "region" ); $city = $k->param( "city" ); $country = $k->param( "country" ); print "Content-type: text/html\n\n"; print "$region\n"; exit; |
|
|
|
|
|
#7 |
|
Confirmed User
Join Date: Dec 2001
Location: Malibu
Posts: 3,817
|
I doubt the "new cgi()" is any good though.
|
|
|
|
|
|
#8 | |
|
Confirmed User
Join Date: Jun 2003
Posts: 1,697
|
Quote:
Thanks for your help. I just tried the exact code here and it still doesn't work. I still get an internal server error message. I don't understand why " use CGI::Carp qw(fatalsToBrowser); " doesn't show anything to help... |
|
|
|
|
|
|
#9 |
|
Confirmed User
Join Date: Dec 2001
Location: Malibu
Posts: 3,817
|
If I run my version here I don't get an error.
Do you have the loaded perl modules installed? These are not standard modules on webair I believe. Hit up webair tech live and tell 'em to install these three: (LWP::UserAgent, HTTP::Request::Common and CGI). |
|
|
|
|
|
#10 |
|
Confirmed User
Join Date: Feb 2002
Location: Seattle
Posts: 1,070
|
you should find the error messages in the server's error log file. check out, or find out, where the server or virtualhost's ErrorLog directive is pointed to (i'm assuming you're using Apache).
adding 'use strict' near the top and using 'perl -wc file.cgi' from the command line may also give you some hints.
__________________
|
|
|
|
|
|
#11 |
|
Viva la vulva!
Join Date: Mar 2003
Location: you can't please everyone, so you got to please yourself
Posts: 16,557
|
The first thing I check is to see if the Perl path is correct and if the script was uploaded as ASCII or binary. That's where I usually screw up.
|
|
|
|
|
|
#12 |
|
♥♥♥ Likes Hugs ♥♥♥
Industry Role:
Join Date: Nov 2001
Location: /home
Posts: 15,841
|
chmod 0755?
__________________
I like pie. |
|
|
|
|
|
#13 |
|
Confirmed User
Join Date: Jun 2003
Posts: 1,697
|
Thanks all for your help.
Yes, Perl path is correct, my files are uploaded as ASCII and were CHMOD 755 - FuqALot : I asked a webair tech to make sure HTTP::Request::Common is installed. I am waiting for his answer. The 2 other Perl models are installed for sure. - salsbury : I am waiting on Webair to have access to my Apache error log file. |
|
|
|
|
|
#14 |
|
Confirmed User
Join Date: Jun 2002
Location: austin, tx
Posts: 1,911
|
perl -e 'use HTTP::Request;'
do the rest of them as well. if it returns 0, you're module is installed. If it bitches, its not.
__________________
http://www.flickr.com/photos/zoddler/ |
|
|
|
|
|
#15 |
|
Confirmed User
Join Date: Jun 2003
Posts: 1,697
|
I finally got access to my error log file.
Here is the error massage I get when I try to run the script: [Mon Feb 20 14:48:23 2006] [error] [client 556.200.545.202] File does not exist: /www/virtual/jonjovi/www.domain.com/public_html/favicon.ico I don't know what it means at all ! |
|
|
|
|
|
#16 |
|
Confirmed User
Join Date: Dec 2001
Location: Malibu
Posts: 3,817
|
That only means that when a browser tries to visit your site, there isn't an icon available (an icon that you would see next to the address in the browser window) - I doubt that's the reason why your perl program isn't doing anything.
What *are* you trying to do? What do you want the perl program to do? |
|
|
|
|
|
#17 | |
|
Confirmed User
Join Date: Jan 2005
Posts: 2,270
|
Quote:
My guess would be that the server your using at webair does not have the correct moduals loaded because when i tried the revised script posted by the other gfy member it worked fine for me.
__________________
E-mail marketing - Automation Scripting - IP Space AIM: splitjoelp ICQ: 254759453 skype - splitjoelp 702-941-6465 |
|
|
|
|
|
|
#18 |
|
So Fucking Banned
Join Date: Jan 2005
Location: At My Desk
Posts: 2,904
|
I can resolve this problem for you
icq 48721721 |
|
|
|
|
|
#19 |
|
Confirmed User
Join Date: Nov 2002
Location: Houston
Posts: 1,130
|
make sure the file is saved in UNIX text mode not DOS text mode. the line breaks are different, so you'll get an error for the next 5 lifetimes.
if you made this in notepad or other such program then it will never work because the line breaks are bad. just download and install Crimson Editor (it's a free code editor), open your script in there, goto Document->File Format->Unix and then save and upload it. Crimson even has an upload feature but just your regular FTP. good luck
__________________
» Looking for Type-in domais? Page Rank domains? Alexa domains? Popular domains? » Domain Research Tool can scan hundreds of thousands of domains to find whatever you're looking for. » Auto-appraise domains and send automated domain offers in bulk with just one click. » Full support for Proxy Servers and International Overture. Try it Free. |
|
|
|
|
|
#20 |
|
So Fucking Banned
Join Date: Jan 2005
Location: At My Desk
Posts: 2,904
|
that's not the problem, however if you have not got a response yet, you should find professional hosting, try http://www.ehosts.org
where the owners are programmers, so you don' t have these problems |
|
|
|
|
|
#21 |
|
making it rain
Industry Role:
Join Date: Oct 2003
Location: seattle
Posts: 22,237
|
I believe webair uses FreeBSD and perl is installed under /usr/local/bin/perl ... It's been a while since I had a webair account though so I could be wrong.
|
|
|
|
|
|
#22 | |
|
Confirmed User
Join Date: Jun 2003
Posts: 1,697
|
Quote:
I need a script that can return me the region of an given IP address. I send the IP and I should get these parameters back: $region = $k->param( "region" ); $city = $k->param( "city" ); $country = $k->param( "country" ); and print them on my screen... Of course, if this works.. I will integrate it in my payment system. I am trying to use Maxmind.com's service. Their customer service has been bad until now. I wrote 5 Emails, got 5 answers but it looks like they don't read my Emails and keep asking me the same questions : What error messages, Wich version of our script are you running ? Gee... Just read my god damn Emails and you have all the informations ! I haven't found another company wich offers the same service until now or I would have switched long ago ! I just got a webair tech checking all my Perl modules needed to run the script and they are all there and up to date. Damn ! I only get "Internal error messages " I don't even get errors in my Apache log file and the command : use CGI::Carp qw(fatalsToBrowser); doesn't work. I don't know what to do. I don't have a clue on what to do and I have been working on this for 48 hours now. I am getting frustrated... |
|
|
|
|
|
|
#23 |
|
Confirmed User
Join Date: Jun 2003
Posts: 1,697
|
ok.. I finally got some error messages on my screen.
Here you are : I have 10 lines like this one with different Global symbol errors : Global symbol "$q" requires explicit package name at /www/virtual/jonjovi/www.domain.com/cgi-bin/example2.pl line 9. |
|
|
|
|
|
#24 |
|
Confirmed User
Join Date: Oct 2005
Location: Charlotte, NC
Posts: 908
|
Is perl working at all on that host? Just make sure by creating a real simple 'hello world' cgi script first..
|
|
|
|
|
|
#25 |
|
Confirmed User
Join Date: Oct 2005
Location: Charlotte, NC
Posts: 908
|
and you really really really should turn on 'use strict;' and initialize all your variables with the my() function...
|
|
|
|
|
|
#26 | |
|
Confirmed User
Join Date: Jun 2003
Posts: 1,697
|
Quote:
Of course ! I have like dozens of scripts working. |
|
|
|
|
|
|
#27 | |
|
Confirmed User
Join Date: Jun 2003
Posts: 1,697
|
Quote:
here is the new script : ############################# #!/usr/bin/perl -wT use strict; use CGI; use CGI::Carp qw(fatalsToBrowser); use diagnostics; use HTTP::Request::Common qw(POST); use LWP::UserAgent; $q = CGI->new(); $ua = LWP::UserAgent->new(); $req = POST 'http://maxmind.com:8010/b', [l => "hgfdgghhh", i => "69.70.92.38" ]; $k = new CGI($ua->request($req)->content); $region = $k->param( "region" ); $city = $k->param( "city" ); $country = $k->param( "country" ); print "Content-type: text/html\n\n"; print "$region\n"; exit; ################################ |
|
|
|
|
|
|
#28 |
|
Confirmed User
Join Date: Oct 2005
Location: Charlotte, NC
Posts: 908
|
Should be:
############################# #!/usr/bin/perl -wT use strict; use CGI; use CGI::Carp qw(fatalsToBrowser); use diagnostics; use HTTP::Request::Common qw(POST); use LWP::UserAgent; my $q = CGI->new(); my $ua = LWP::UserAgent->new(); my $req = POST 'http://maxmind.com:8010/b', [l => "hgfdgghhh", i => "69.70.92.38" ]; my $k = new CGI($ua->request($req)->content); my $region = $k->param( "region" ); my $city = $k->param( "city" ); my $country = $k->param( "country" ); print "Content-type: text/html\n\n"; print "$region\n"; exit; |
|
|
|
|
|
#29 | |
|
Confirmed User
Join Date: Jun 2003
Posts: 1,697
|
Quote:
Internal server error... |
|
|
|
|
|
|
#30 |
|
Confirmed User
Join Date: Dec 2001
Location: Malibu
Posts: 3,817
|
If you want you could give me a username and password to your ssh and server. I will try to fix it then. You may trust me.
Does it somewhere on maxmind say what your perl program needs to do, what parameters it has to pass and receive? If so, I could get you something going in minutes - free. |
|
|
|
|
|
#31 |
|
Damn Right I Kiss Ass!
Industry Role:
Join Date: Dec 2003
Location: Cowtown, USA
Posts: 32,428
|
FuqALot helped me before with similar shit... Good guy.
|
|
|
|
|
|
#32 | |
|
Confirmed User
Join Date: Dec 2001
Location: Malibu
Posts: 3,817
|
Quote:
|
|
|
|
|
|
|
#34 |
|
<&(©¿©)&>
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
|
it's been 3 days, and you are still looking for someone to fix the problem? Offer a few bucks, and i'm sure someone will hook it up in no time...
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000 Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager ![]() Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager |
|
|
|
|
|
#35 |
|
Confirmed User
Join Date: Jun 2002
Location: austin, tx
Posts: 1,911
|
A: sounds to me like you turned on strict and don't know what it means, and B: did you try the perl -e trick above to make sure you modules are installed?
__________________
http://www.flickr.com/photos/zoddler/ |
|
|
|