October 1st, 2000, 06:25 AM
i have a unix system & a window system..i always do my perl programming in a txt file(win) then i transfer over to my unix to run. then i noticed something very strange..sometimes when i transfer..it turns out to be a console file which means it is correct(able to run) but sometimes when i transfer over it turns out to be a executable format file of unix...i have changed the extension of the txt file to .cgi before i bring it over to unix system...can someone just enlighten me with this problem. i'm getting no where by trying my luck so many things everytime i needed to transfer a new file over...
Another ? is where to download the perl intepretor for wins..i mean how to run perl on win98 system.
October 1st, 2000, 06:43 AM
>>it turns out to be a executable format file of unix
What do you mean?
>>i have changed the extension of the txt file to .cgi before i bring it over to unix system
Make sure your FTP client transfers .cgi or .pl in ASCII format. If your FTP client doesn't already configured that by default, then it sucks and you should consider another FTP client. I like LeapFTP but many use CuteFTP.
>>where to download the perl intepretor for wins
October 2nd, 2000, 01:48 AM
first let me clarify ur ?s..when i mean i transfer the file to unix system i mean using a diskette & copy over not using FTP..
secondly the cgi file has to be in the console format(a pc picture) or wat we call a shell script then can run. the executable format of unix which i mention has a pic which looks like a nut of screw(hope u get wat i mean).
And my question is i cannot run the file i wrote in wins using txt editor after using a diskette to copy over to my unix system. The reason why i didn't use ftp bcoz my pathner has misconfigure the ftp server & the unix pc is just beside my wins pc.
Another question is whether i need to configure my apache in order to properly run cgi scripts. i took certain scripts(found inside unix) to try and run,it works..but those simply print commands i wrote in the script for testing purposes can't be executed.
Note: when i do a perl test.cgi, it is able to print something. When i placed in under cgi-bin to run on web, it failed. saying 500 internal server error.
someone pls help me...thanks
October 2nd, 2000, 02:17 AM
>>the cgi file has to be in the console format(a pc picture)
There is no such format. What you really mean is the icon for your file viewing from your KFM in KDE.
Regardless of which way you transfer your cgi files, you more than likely need to chmod it to 755 (-rwxr-xr-x).
>>saying 500 internal server error
Just saying 500 error tells nothing since it could be dozen of possibilities. Make sure your script has 755 permission and it has the following line before the output:
print "Content-type: text/htmlnn";
October 2nd, 2000, 06:32 AM
thanks anyway freebsd...i am figuring out where the problem lies, hoping to find an answer to my ?..thanks