For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > March 2004 > Re: Does anyone know what this switch does?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Does anyone know what this switch does?
Joe Smith

2004-03-28, 10:22 pm

Rob Vunderink wrote:

> http://www.opstartpagina.nl/cgi-bin/ipadres.cgi
> It works.


Check.

> Now check out this url:
> http://angel.regioportals.nl/gelder...bin/ipadres.cgi


Opening ipadres.cgi
The file "padres.cgi is of type application/x-httpd-php, and Mozilla does no
know how to handle this file type. This file is located at:
http://angel.regioportals.nl/gelderlander/cgi-bin/
What should Mozilla do with this file?
( ) Open it with the default application
( ) Open it with ___________________________ [Choose...]
(*) Save it to disk

> It does not work, although the scripts are the same in both cases:
>
> = - = - = - = - = - = - = - = -
> #!/usr/bin/perl
>
> http://angel.regioportals.nl/gelder...in/ipadres2.cgi
>
> It works. The script is:
> #!/usr/bin/perl --


Clearly an end-of-line upload problem.

It fails because "/usr/bin/perl^M" does not exist (where ^M represents
the Classic Mac end-of-line and one half of the MS-DOS end-of-line).

Changing the shebang line to include a space and any switch ("-w", "-T")
works because the program loader stops at the space, and therefore
knows the right interpreter to load.

It appears that the web server at angel.regioportals.nl is configured
to not produce a "500 Server Error" when the shebang line is bad, and
outputs "Content-type: application/x-httpd-php" instead.
I'd say the server is misconfigured, in that it does not invoke the
php-handler in this case.

The fix is to tell your FTP client to use ASCII mode instead if IMAGE
(binary) mode when uploading your scripts.
-Joe
Rob Vunderink

2004-03-28, 10:22 pm

Thanks, Joe, this is the most complete and clear answer I got.
Rob Vunderink
= - = - = - = - = - = - =

in article 1aw9c.21936$K91.66988@attbi_s02, Joe Smith at Joe.Smith@inwap.com
wrote on 28-03-2004 09:38:

> Rob Vunderink wrote:
>
>
> Check.
>
>
> Opening ipadres.cgi
> The file "padres.cgi is of type application/x-httpd-php, and Mozilla does no
> know how to handle this file type. This file is located at:
> http://angel.regioportals.nl/gelderlander/cgi-bin/
> What should Mozilla do with this file?
> ( ) Open it with the default application
> ( ) Open it with ___________________________ [Choose...]
> (*) Save it to disk
>
>
> Clearly an end-of-line upload problem.
>
> It fails because "/usr/bin/perl^M" does not exist (where ^M represents
> the Classic Mac end-of-line and one half of the MS-DOS end-of-line).
>
> Changing the shebang line to include a space and any switch ("-w", "-T")
> works because the program loader stops at the space, and therefore
> knows the right interpreter to load.
>
> It appears that the web server at angel.regioportals.nl is configured
> to not produce a "500 Server Error" when the shebang line is bad, and
> outputs "Content-type: application/x-httpd-php" instead.
> I'd say the server is misconfigured, in that it does not invoke the
> php-handler in this case.
>
> The fix is to tell your FTP client to use ASCII mode instead if IMAGE
> (binary) mode when uploading your scripts.
> -Joe


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com