in reply to Re: GD and LWP giving 500 errors
in thread GD and LWP giving 500 errors
I have installed loads of modules and they all work except for GD and LWP. I can imagine LWP being abused for phishing sites - perhaps that's why it's blocked. But GD??#!/usr/bin/perlml use CGI::Carp qw(fatalsToBrowser); print "content-type: text/plain\n\nTesting"; use LWP::UserAgent;
I'll try the @INC idea...
Meanwhile, anyone got a non-LWP way of POSTing?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: GD and LWP giving 500 errors
by huck (Prior) on Mar 17, 2017 at 01:51 UTC | |
more fancy result (to term)
Edit to add: interesting there are two modules LWP and GD share adding below addin('Data::Dumper',1); may identify your problem, but both are core edit2: just noticed CGI::Carp qw(fatalsToBrowser) brought in Config, and that worked it seems Edit 3: fixed addin so Dump::Dumper doesnt have to be the first one added, left old as addin_old but it can be deleted if ya want | [reply] [d/l] [select] |
by Schmunzie (Beadle) on Mar 17, 2017 at 11:49 UTC | |
With perlml in the shebang, it gave a 500 error. With just perl, it gave
| [reply] [d/l] |
by huck (Prior) on Mar 17, 2017 at 12:10 UTC | |
If you want to try again under perlml strike the following line those are the only non evaled use statments. if it works, whew. otherwise it looks like LWP came in, but CGI/Carp and GD didnt you can strike addin('x::x',1); too. that was just there to display how a nonfound module would behave, and you got those. You could try adding addin('LWP::Simple',1); to see if it can find that. What it is doing is running the use statments under an eval. eval will trap the die preventing the script from issueing an error at that point and dieing. Since dieing means no output is sent back thats why you got the 500. It also lists all the modules added by that use statment. Since one module can use many others it can be quite informative. | [reply] [d/l] [select] |
|
Re^3: GD and LWP giving 500 errors
by huck (Prior) on Mar 16, 2017 at 23:39 UTC | |
try Notice i commented out the lwp use. if that works then try notice the change to a require in an eval. and x::x to prove it does fail right. edit: dayum forgot "use Data::Dumper;" | [reply] [d/l] [select] |
by Mr. Muskrat (Canon) on Mar 17, 2017 at 14:09 UTC | |
HTML won't render if you use a text/plain content type. | [reply] |
|
Re^3: GD and LWP giving 500 errors
by huck (Prior) on Mar 16, 2017 at 23:14 UTC | |
Meanwhile, anyone got a non-LWP way of POSTing? https://superuser.com/questions/149329/what-is-the-curl-command-line-syntax-to-do-a-post-request now i am confused, you cant reach the hosting site with LWP from somewhere else? or the hosting site cant reach other sites with LWP? | [reply] |
by Schmunzie (Beadle) on Mar 17, 2017 at 11:10 UTC | |
and it seems to work. The bit that is now confusing me is how to replace LWP's is_error(status) and is_success(status)There is barely a mention of response codes in the curl documentation. LATER...Thanks to a search of StackOverflow, I now have a working workaround that give me access to the response code
| [reply] [d/l] [select] |
by Schmunzie (Beadle) on Mar 16, 2017 at 23:26 UTC | |
Thanks for the link | [reply] |