RE: [PHP] Re: exec works with some, but not all commands

From: Date: Sun, 25 Jul 2004 02:12:52 +0000
Subject: RE: [PHP] Re: exec works with some, but not all commands
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-191795@lists.php.net to get a copy of this message
when running shell commands form php/web apps... it's a good idea to check the ownership/privs/permissions of both the exe being run, as well as any output/input files for the exe app. you should also check the web/apache/iis error/log files to determine if everything is correct... regards, -----Original Message----- From: news [mailto:news@sea.gmane.org]On Behalf Of Chris Martin Sent: Saturday, July 24, 2004 6:26 PM To: php-general@lists.php.net Subject: [PHP] Re: exec works with some, but not all commands Matthew Sims wrote: >>why would exec("touch /var/www/testfile.txt") work but not >> >>exec("/usr/bin/gpg --homedir /home/testuser/.gnupg blah blah blah") >> >>the dir used in homedir has mode 777 just for testing >> >> >>this is the actual command I'm trying to run... >>exec("/usr/bin/gpg --homedir /home/testdir/.gnupg --armor --output e.gpg >>-e -r uid_someuser sf.txt"); >> >>if I run it from the command line, it works fine... >> > > > I'm not sure but what if you defined an absolute path for your output > files (e.gpg and sf.txt). > I'm not sure either, but I was thinking absolute too. Also you might try system(), shell_exec(), or passthru() if you're trying to get output back. -- Chris Martin Web Developer Open Source & Web Standards Advocate http://www.chriscodes.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#191795) next »