Go Back   CodingForums.com > :: Server side development > Perl/ CGI

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-04-2010, 05:01 PM   PM User | #1
jlfmssm
New to the CF scene

 
Join Date: Apr 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
jlfmssm is an unknown quantity at this point
Smile system() in CGI doesn't work

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
jlfmssm is offline   Reply With Quote
Old 04-05-2010, 05:46 AM   PM User | #2
MetalGear
New Coder

 
MetalGear's Avatar
 
Join Date: Feb 2008
Location: Jambudvipa
Posts: 56
Thanks: 6
Thanked 1 Time in 1 Post
MetalGear is an unknown quantity at this point
this might help...
http://www.codingforums.com/showthread.php?t=69624
MetalGear is offline   Reply With Quote
Old 04-05-2010, 03:58 PM   PM User | #3
FishMonger
Super Moderator


 
Join Date: May 2005
Location: Southern tip of Silicon Valley
Posts: 2,757
Thanks: 2
Thanked 149 Times in 144 Posts
FishMonger will become famous soon enoughFishMonger will become famous soon enough
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?
FishMonger is offline   Reply With Quote
Reply

Bookmarks

Tags
apache, cgi, perl, system, webserver

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting 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

Forum Jump


All times are GMT +1. The time now is 01:24 AM.


Advertisement
Log in to turn off these ads.