Running a socket C prrogram
Posted: Mon Nov 10, 2008 11:54 pm
Hi,
I have a php web page. I need to run a C program which creates a socket and sends an IP packet to another machine. The C program is working fine.
I am using the exec command in my php script to run this program from the script. But the problem is when I run this script on the shell by giving sudo php<filename> , it runs fine and send the ip packet. But when I run it in a browser, the c program is not being run. I think it is a problem with some permissions. When I checked the error log I get the message, Error creating socket. But it runs fine without any errors from the shell. Please help me regarding this.
I have a php web page. I need to run a C program which creates a socket and sends an IP packet to another machine. The C program is working fine.
I am using the exec command in my php script to run this program from the script. But the problem is when I run this script on the shell by giving sudo php<filename> , it runs fine and send the ip packet. But when I run it in a browser, the c program is not being run. I think it is a problem with some permissions. When I checked the error log I get the message, Error creating socket. But it runs fine without any errors from the shell. Please help me regarding this.