![]() |
Perl help
I just installed a script, everything was installed properly (to my knowledge) but I seem to have an error when trying to run it.
http://www.ydl.ca/cgi-bin/puw/puw_setup.cgi Anyone know where I should start? |
ssh as root and do "tail /var/log/messages" and that might give you a bit more input as to what exactly the error was.
|
Quote:
|
make sure you give it permisions to excecute.
|
Quote:
|
Quote:
|
Quote:
|
Quote:
|
Quote:
|
I assume script255 is a script its calling make sure its set to 777 just for the hell of it.
/home/www/ydl.ca/cgi-bin/puw/puw_setup.cgi should it not be usr/home/www ect or does that even matter. Im not a perl expert I'm a ASP/VB expert who just converted and saw the light of php |
login with ssh and do:
perl -pw /home/www/ydl.ca/cgi-bin/puw/puw_setup.cgi you should see some detailed errors. if you say its 755 then it looks you didn't uploaded in ascii |
kick the box :)
|
Near the top of the script, like the third or fourth line down, add this line, it'll be more helpful than a "malformed header" message:
use CGI::Carp qw(fatalsToBrowser); |
|
Problem is that the script seems to be handling errors itself, so it's hard to say exactly what the issue is. There have been a few suggestions here that might help though.
|
Quote:
|
Quote:
|
Quote:
"Could not execute script" contradicts that I'm not seeing it like "Could not execute script255" that 255 looks more like a line number or an error code |
Quote:
|
Quote:
|
oh :winkwink:
|
Just get someone you trust onto your server to look at it, this isn't going to go anywhere without real error messages... :)
|
Quote:
|
Quote:
|
Maybe make sure it was uploaded properly? Not sure without looking at the code and errors specifically but sometimes if you upload scripts improperly it will screw them up. Just another thing to look at and im not sure if this script would work at all in that instance, but just an idea.
|
(grope, grope, I hope that's the elephant's trunk omg)
OK, what the error message from web says to me is only that for some reason the script could not execute - could be anything, if it's all 755, double-check your paths, make sure the script doesn't require any other Perl packages, make sure you can do vi thescript.pl (whatever the script's full name is) and it isn't all on one line with lots ^Ms all over the place. (If so, it won't run, those mean it's a text file that was extracted or uploaded as binary). Command line is the only way to go here ./thescript.pl If it doesn't give errors on command line, that'd be weird. Check your web server error log for clues. What's happening is invisibly anything on the web sends what's called a header like Content-Type:text/html With two carriage returns after it. If the script can't execute, the header gets garbled by the error message. -doug |
Even more basic...did you edit the script?
If so, you need to use a text editor that keeps the ASCII formatting intact (wordpad doesn't do this by default.) Make sure "word wrap" is OFF. Upload in ASCII mode with your FTP client. CHMOD files 755. If you don't want to invoke the CGI module, Creata a blank text file in notepad, name it error.txt, and upload it into your main HTML directory. Then add this code to the top of your script directly below the shebang- BEGIN { open (STDERR, ">/path/to/error_file/error.txt"); } replace the path with the server side path to the text file. Then just open error.txt in browser to get more complete error messages. GL |
run perl -wc script in the cgi's directory. that will catch most problems.
now the issue here is apparently that puw_setup.cgi is calling a script (one way or another). and is printing the string "Cannot execute the script" and "255" (that is, seperately). 255 is the return code. i'd bet on it. it's printing it before the Content-type header is printing. check with your host... but maybe the ownership of the script is wrong? or maybe the permissions on the script directory are wrong (they should not be 777 (nor should the script)). if you aren't sure how to check that, log in to the server, to the cgi directory, and run: "ls -alR" and post the output somewhere, and we can tell ya. |
Quote:
|
All times are GMT -7. The time now is 11:49 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123