[thelist] Cannot write CGI scripts on a Mac

martin.p.burns at uk.pwcglobal.com martin.p.burns at uk.pwcglobal.com
Mon Feb 25 09:45:01 CST 2002


Memo from Martin P Burns of PricewaterhouseCoopers

-------------------- Start of message text --------------------

Hi Michael

It's almost certainly nothing to do with BBEdit - it's extremely
good at being a plain text editor which won't mess with anything.

When I bought the DW+BBEdit bundle way back, I bought it for the
DW bit, but made way more money from the BBEdit portion, writing
and customising CGI scripts.

Here's the most likely things to check:
1) Try a *really* simple, ie something like:

#/usr/bin/perl
#or wherever perl lives of course
print 'hello world\n';

   and upload it.

2)Assuming you've got shell access, run it from the command
   line, which may take forcing the shell to accept that it's
   Perl eg:
perl ./helloworld.cgi

3) If it works, you've likely got a problem with the script you're writing.
   *check* your http headers, *check* line-ends for semi-colons,
   *check* for correct closing of quotes (BBEdit colour coding is wonderful
    for this).

4) If it doesn't, manually force Fetch to upload the script as ASCII, and
look
   to see if it's automatically setting the upload type (and if it is,
check the
   correlation between your file extension and the upload type).

If you're on OSX, then it's a super setup for testing cgi scripts as you've
got
Apache and Perl already there for you. Take a look at Morbus' tutorials
on O'Reillynet for info on setting it all up:
http://www.oreillynet.com/pub/a/mac/2001/12/14/apache_two.html


Cheers
Martin



Subject:    [thelist] Cannot write CGI scripts on a Mac



I'm having no luck at all creating CGI scripts on my Mac.  I've downloaded
the Lite BBEdit, and I've zapped gremlins, etc.  I've set the file creator
and save state options to 'BBEdit' and line breaks to 'Unix'.  I've
uploaded
as text, but I'm still get the old 500 Internal server error problem.

I'm pretty sure that it's nothing to do with Fetch, as I've downloaded a
script from my cgi-bin that I know works, reuploaded it, and it seems to be
okay.

I'm going to have to resort to uploading the script from work, going home
to
my PC, downloading it, cutting and pasting into a notepad document,
uploading, going back to work, and testing it  Not sure the boss would go
for that option.


--------------------- End of message text --------------------

This e-mail is sent by the above named in their
individual, non-business capacity and is not on
behalf of PricewaterhouseCoopers.

PricewaterhouseCoopers may monitor outgoing and incoming
e-mails and other telecommunications on its e-mail and
telecommunications systems.
----------------------------------------------------------------
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material.  Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited.   If you received
this in error, please contact the sender and delete the material from any
computer.




More information about the thelist mailing list