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 > Mac OS X > cgi (pl) not working on 10.4?

cgi (pl) not working on 10.4?
Thread Tools
Fresh-Faced Recruit
Join Date: Jul 2005
Status: Offline
Reply With Quote
Jul 22, 2005, 02:25 AM
 
Hi, I'm trying to do my testing offline so I enabled Personal Web Server. PHP already working (mostly) but no way with cgi scripts.

I'm editing them on TextEdit (preferences set to plain text)
As an example, I'm trying to run test.pl (/Library/WebServer/CGI-Executables) that looks like:
#!/usr/bin/perl
print "Content-type: text/html\r\n\r\n";
print "Hello, World.";

I already chmod it to 755

But if I test it on Terminal (wchich, by the way I'm not familiar at all with) using ./test.pl
I get the message
./test.pl: line 2: print: command not found
./test.pl: line 3: print: command not found

My perl is in usr/bin (usr/local/bin dowsn't even exist)
I checked http.conf and Aliases points to CGI-Executables

So... what can I do now?
     
Junior Member
Join Date: Mar 2001
Location: Over there
Status: Offline
Reply With Quote
Jul 29, 2005, 09:12 AM
 
I believe the problem is TextEdit. I just created your script in TextWrangler and it ran fine, but it fails miserably when I create the script in TextEdit (even in plain text mode).
     
   
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 07:51 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