system(), passthru(), exec() not working as from command line
| From: | Peter Janett | Date: | Sun, 20 Jan 2002 17:42:04 +0000 |
| Subject: | system(), passthru(), exec() not working as from command line | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-81274@lists.php.net to get a copy of this message | ||
I'm trying to get gnupg (OpenPGP) working on my system, which is Solaris 2.6
on Sparc, with PHP 4.0.6 and Apache/Stronghold.
I have the program compiled, as it works at the command line. Here's what
works at the command line:
/usr/local/bin/gpg --encrypt -ao /usr/local/www/htdocs/777/crypted -r
'<phplist@newmediaone.net>'
/usr/local/etc/www/htdocs/777/plain_text_mesage.txt
If I type the above at the command line, when logged in as the user Apache
and PHP is running as (nobody), it encrypts the contents of the file
/usr/local/etc/www/htdocs/777/plain_text_mesage.txt and writes it to the
file /usr/local/www/htdocs/777/crypted, which is what I want. (The
directory /usr/local/www/htdocs/777/ is "chmod 777", and PHP can write a
file in that directory.)
I've tried everything I can think of, but it looks like a command from PHP
is not working like it is at the command line.
I've tried:
system("/usr/local/bin/gpg --encrypt -ao
/usr/local/www/htdocs/777/crypted -r '<phplist@newmediaone.net>'
/usr/local/etc/www/htdocs/777/plain_text_mesage.txt");
passthru("/usr/local/bin/gpg --encrypt -ao
/usr/local/www/htdocs/777/crypted -r '<phplist@newmediaone.net>'
/usr/local/etc/www/htdocs/777/plain_text_mesage.txt");
exec("/usr/local/bin/gpg --encrypt -ao /usr/local/www/htdocs/777/crypted -r
'<phplist@newmediaone.net>'
/usr/local/etc/www/htdocs/777/plain_text_mesage.txt");
$command= `(/usr/local/bin/gpg --encrypt -ao
/usr/local/www/htdocs/777/crypted -r '<phplist@newmediaone.net>'
/usr/local/etc/www/htdocs/777/plain_text_mesage.txt`;
(Each of the above 4 lines of code probably word wrapped in this email, and
the last line contains backtics, not single quotes.)
So, I'm stumped. I was following the basics of the article at:
http://hotwired.lycos.com/webmonkey/00/20/index3a.html?tw=programming
Thanks,
Peter Janett
New Media One Web Services
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
New Upgrades Are Now Live!!!
Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1
Sun Solaris (UNIX) accounts - PHP 4.0.6, mod_perl/1.25,
Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PostgreSQL coming soon!
http://www.newmediaone.net
webmaster@newmediaone.net
(303)828-9882