where does exec look for the program?

From: Date: Wed, 11 Oct 2000 18:07:06 +0000
Subject: where does exec look for the program?
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-19652@lists.php.net to get a copy of this message
Hello, this is my first time on this list, so be gentle. I am also new to PHP. I have compiled a small c program called regkey, which computes a key. I have it installed in my cgi-bin of my webserver It is marked as executable (755), and it runs correctly from a telnet session. I am trying to exec it from a php file. the code below always fails with a code of 2, or file not found. <?php // compute new key $cmdline = "\"$fullname\" . \"Micro-Magic\" . \"$SerialNo" ; $RegKey = exec("/home/umagic/cgi-bin/regkey $cmdline", $msgs,$rc) ; ?> I have heard that you can only exec things in the apache path. Is there a way to work around this? the following works: $RegKey = exec("ls -d", $msgs,$rc) ; regards, Rich Peters

« previous php.general (#19652) next »