On Jun 17, 2014, at 1:10 AM, Philippe Rousselot <rousse...@rousselot.org> wrote:
> Hi, > > I know nothing about perl and I have a problem with a cgi script for a > website called geneweb (genealogy stuff). > > I moved from one web site to another and now the site does not work and give > me a 500 error message. Do you have access to the web server logs? Those could be very helpful in diagnosing your error. > the script I need to call the program is the following > > ~~~~~~ > #!/bin/sh > DIR=/homez.xxx/xxxx/www/geneweb607/gw > cd $DIR > $DIR/gwd -cgi 2>/dev/null > > ~~~~~~ > > I guessed, but I may be wrong that I cannot use a sh script (I checked for > files and folders rights) I am no web expert, but as far as I know, there is no reason why you can’t run a shell script as a CGI program. However, there may be security issues, and you may have reconfigure your server. You are probably better off using Perl instead. > Could someone give me a translation in perl of this script so I can try out > this idea Here is a Perl program that does the same thing as your shell script: #!/bin/env perl use strict; use warnings; my $dir = q(/homez.xxx/xxxx/www/geneweb607/gw); system(“cd $dir;$dir/gwd -cgi 2>/dev/null”)’ Good luck! -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/