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

04-04-2010, 06: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.


04-05-2010, 06:46 AM
this might help...

04-05-2010, 04: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?