problems with system() call

From: Date: Fri, 25 Jun 2004 05:20:08 +0000
Subject: problems with system() call
Groups: php.general 
Request: Send a blank email to php-general+get-189030@lists.php.net to get a copy of this message
Hi - I'm writing a php script that will result in the parrellel port being written to. I wrote a program in C that will actually do the writing. This program has to be run as root so that it can write to the hardware address. I have the permissions on the file set to u+s so that the program is always run as root no metter who runs it. If I open a shell on the machine and login as a regular user I can invoke the program and pass it the value I want to write to the port and it will work fine. So, I should be able to invoke it from my php script by doing something like this: system("write_port 0xffffffff"); When I call this from the script the port does not get written to. Anybody have any ideas why that would be? When I invoke the script from a web server who's context is it running in? I'm running PHP 4.2.2 on a Linux Redhat 9 box (kernal 2.4.20-6) and apache 2.0. Thanks in advance for any help you can give. Jim

« previous php.general (#189030) next »