Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Apache/Personal Web Sharing: how can I test my Perl form?

Apache/Personal Web Sharing: how can I test my Perl form?
Thread Tools
Senior User
Join Date: Dec 2000
Status: Offline
Reply With Quote
Jan 22, 2004, 02:26 AM
 
I've got an HTML form connecting to a little Perl script I've been testing on my paid host's remote BSD server... but I'd like to test it on my own Mac (Panther) instead.

I can access Perl from Terminal just fine, but when I put my files into Sites and turn on Web Sharing, submitting the form doesn't work. (405: Post not allowed). I used chmod to make sure permissions were right, but no dice... there are surely some gaps in my expertise!

Is there something I need to do with Apache? Or do I need to locate the Perl script someplace particular? (On my paid host, I can put it anywhere I like as long as my HTML posts to the proper path.)

I've never actually configured a web server before, just worked with the one I pay a host for. But I'm ready to learn. Local testing of web forms with Perl would be SO useful.

Advice/links appreciated. Thanks!
(Last edited by nagromme; Jan 22, 2004 at 12:14 PM. )
     
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status: Offline
Reply With Quote
Jan 22, 2004, 04:17 AM
 
perl scripts go in /Library/WebServer/CGI-Executables

call them like this: http:/127.0.0.1/cgi-bin/myScript.pl

you said you've correctly changed the permissions, but, if you get a 500 error, chances are that the line breaks are Mac instead of Unix. you can fix this easily in Terminal, as follows:

type perl -pi -e 's/\r/\n/g' (leave a space at the end), and then drag your file(s) onto the Terminal window and hit Enter. try the file in your browser again, and it should work fine.

hope that helps
"Have sharp knives. Be creative. Cook to music" ~ maxelson
     
Senior User
Join Date: Dec 2000
Status: Offline
Reply With Quote
Jan 22, 2004, 12:49 PM
 
Thanks--I will try moving the script.

(I'm using BBEdit, so I can control the line breaks.)
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:52 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2