...

View Full Version : system() in CGI doesn't work



jlfmssm
04-04-2010, 05:01 PM
I use apache to make web server, in /cgi-bin/ I made a test.cgi.
there are some code like the following:

system ("chown apache.apache /cgi-bin/enm");
system ("chmod 777 /cgi-bin/enm");
system ("chmod 777 /cgi-bin/enm/*");
system "sh /var/www/cgi-bin/enm/run.bat";

I already give permission to /cgi-bin, but it seems system does't do anything.
However if I run sh /var/www/cgi-bin/enm/run.bat in command line, it works.
I am working on linux.

Could anyone help me.

jlf

MetalGear
04-05-2010, 05:46 AM
this might help...
http://www.codingforums.com/showthread.php?t=69624

FishMonger
04-05-2010, 03:58 PM
Why are you using system calls to chown and chmod when Perl has those commands built-in?

Why are you setting the permissions to 777? That opens up security concerns.

Why are you using a system call to execute run.bat when Perl can run it directly?

Where's your error handling?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum