LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   exec a C prg in a CGI Perl script (https://www.linuxquestions.org/questions/linux-networking-3/exec-a-c-prg-in-a-cgi-perl-script-328645/)

jagman 05-30-2005 05:16 PM

exec a C prg in a CGI Perl script
 
Good Day to all of you.
Im starting to study Perl languaje for creating some CGI scripts.
Im trying to execute a C program that I made, inside the CGI script , and take the results from the C program (some graphics made with the gdc library and some data) and print it on a HTML document.
My question is how do i execute or run a C program inside a CGI Perl script?

I already tried a call to system and exec the C program; the C program executes during a certain amount of time chosen by the user.

Technoslave 05-31-2005 10:08 AM

With the "system" call.

jagman 05-31-2005 10:40 AM

I already tried the system call and it work but the problem is that the C program that I need to execute has to be executed by root. When the server tries to exec to C program via the system call, the execution fails.
How can i give the server Apache the permision to execute the C program as a root.?
And what will be the consecuences of enabling the server to do exec as root?


All times are GMT -5. The time now is 07:04 AM.