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.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 02-17-2006, 10:16 AM   #1
CHMOD
Confirmed User
 
CHMOD's Avatar
 
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 !
CHMOD is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2006, 10:31 AM   #2
swedguy
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.
swedguy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2006, 01:00 PM   #3
CHMOD
Confirmed User
 
CHMOD's Avatar
 
Join Date: Jun 2003
Posts: 1,697
Quote:
Originally Posted by swedguy
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.
Thanks !

I corrected this misstake but it still doesn't work.

I just asked webair to let me see my Apache's error log.
CHMOD is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2006, 01:03 PM   #4
Harrison Richard
Confirmed User
 
Join Date: Oct 2005
Posts: 199
Quote:
Originally Posted by swedguy
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.

CGI::Carp qw/fatalsToBrowser/ would catch this.

OP is correct to check apache logs.
__________________
i sale executive summaries of threads
Harrison Richard is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2006, 01:04 PM   #5
Harrison Richard
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
Harrison Richard is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2006, 01:37 PM   #6
FuqALot
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;
FuqALot is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2006, 01:39 PM   #7
FuqALot
Confirmed User
 
Join Date: Dec 2001
Location: Malibu
Posts: 3,817
I doubt the "new cgi()" is any good though.
FuqALot is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2006, 01:49 PM   #8
CHMOD
Confirmed User
 
CHMOD's Avatar
 
Join Date: Jun 2003
Posts: 1,697
Quote:
Originally Posted by FuqALot
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;
Hi !

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...
CHMOD is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2006, 01:52 PM   #9
FuqALot
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).
FuqALot is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2006, 01:58 PM   #10
salsbury
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.
__________________

Last edited by salsbury; 02-17-2006 at 02:00 PM..
salsbury is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2006, 02:21 PM   #11
mikeyddddd
Viva la vulva!
 
mikeyddddd's Avatar
 
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.
mikeyddddd is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2006, 02:22 PM   #12
Babaganoosh
♥♥♥ Likes Hugs ♥♥♥
 
Babaganoosh's Avatar
 
Industry Role:
Join Date: Nov 2001
Location: /home
Posts: 15,841
chmod 0755?
__________________
I like pie.
Babaganoosh is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2006, 02:42 PM   #13
CHMOD
Confirmed User
 
CHMOD's Avatar
 
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.

Last edited by CHMOD; 02-17-2006 at 02:43 PM..
CHMOD is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2006, 02:42 PM   #14
toddler
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.
toddler is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-20-2006, 12:52 PM   #15
CHMOD
Confirmed User
 
CHMOD's Avatar
 
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 !
CHMOD is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-20-2006, 01:27 PM   #16
FuqALot
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?
FuqALot is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-20-2006, 01:44 PM   #17
split_joel
Confirmed User
 
Join Date: Jan 2005
Posts: 2,270
Quote:
Originally Posted by CHMOD
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 !

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
split_joel is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-20-2006, 02:00 PM   #18
teksonline
So Fucking Banned
 
Join Date: Jan 2005
Location: At My Desk
Posts: 2,904
I can resolve this problem for you

icq 48721721
teksonline is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-20-2006, 02:05 PM   #19
Luc
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.
Luc is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-20-2006, 02:07 PM   #20
teksonline
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
teksonline is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-20-2006, 02:21 PM   #21
fuzebox
making it rain
 
fuzebox's Avatar
 
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.
fuzebox is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-21-2006, 02:57 PM   #22
CHMOD
Confirmed User
 
CHMOD's Avatar
 
Join Date: Jun 2003
Posts: 1,697
Quote:
Originally Posted by FuqALot
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?

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...

Last edited by CHMOD; 02-21-2006 at 02:58 PM..
CHMOD is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-21-2006, 03:05 PM   #23
CHMOD
Confirmed User
 
CHMOD's Avatar
 
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.
CHMOD is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-21-2006, 03:07 PM   #24
drjones
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..

Last edited by drjones; 02-21-2006 at 03:08 PM..
drjones is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-21-2006, 03:10 PM   #25
drjones
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...
drjones is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-21-2006, 03:11 PM   #26
CHMOD
Confirmed User
 
CHMOD's Avatar
 
Join Date: Jun 2003
Posts: 1,697
Quote:
Originally Posted by drjones
Is perl working at all on that host? Just make sure by creating a real simple 'hello world' cgi script first..

Of course !


I have like dozens of scripts working.
CHMOD is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-21-2006, 03:13 PM   #27
CHMOD
Confirmed User
 
CHMOD's Avatar
 
Join Date: Jun 2003
Posts: 1,697
Quote:
Originally Posted by drjones
and you really really really should turn on 'use strict;' and initialize all your variables with the my() function...
I did.
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;

################################
CHMOD is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-21-2006, 03:15 PM   #28
drjones
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;
drjones is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-21-2006, 04:21 PM   #29
CHMOD
Confirmed User
 
CHMOD's Avatar
 
Join Date: Jun 2003
Posts: 1,697
Quote:
Originally Posted by drjones
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;

Internal server error...
CHMOD is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-21-2006, 04:27 PM   #30
FuqALot
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.
FuqALot is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-21-2006, 05:21 PM   #31
V_RocKs
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.
V_RocKs is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-21-2006, 05:24 PM   #32
FuqALot
Confirmed User
 
Join Date: Dec 2001
Location: Malibu
Posts: 3,817
Quote:
Originally Posted by V_RocKs
FuqALot helped me before with similar shit... Good guy.
I did? Hah it's been years I did something for people other than myself (for money), so I guess it was a freebie? Don't remember. - Anyway I would've done this for free too.
FuqALot is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-21-2006, 05:37 PM   #33
mikeet
this & that
 
Industry Role:
Join Date: May 2005
Location: Beer City
Posts: 5,354
Not sure if this will work, but try using:
#!/usr/local/bin/perl -wT

instead of:
#!/usr/bin/perl -wT
__________________
w4sex
mikeet is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-21-2006, 06:15 PM   #34
woj
<&(©¿©)&>
 
woj's Avatar
 
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
woj is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-21-2006, 06:27 PM   #35
toddler
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?
toddler is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.