Starting dos application from php
| From: | Adrian Badoiu | Date: | Wed, 03 Mar 2004 16:24:52 +0000 |
| Subject: | Starting dos application from php | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-179357@lists.php.net to get a copy of this message | ||
Hi,
I'm Adrian and I have the following problem:
I have to encrypt a text file. For that I use a PGP DOS version (PGP 2.6 ui - Unofficial
International, because I'm outside of the US).
I installed the PGP and it is working fine when starting it from a Dos command line:
c:\PGP> -e test_1.txt adrian //The result of this command is that it creates the encrypted
file (textfile.pgp) using my pubkey.
Then I created a batch file (called cript.bat) like this:
@echo off
SET PGPPASS=xxxxxyyyyy //This is my cipherphrase
cd pgp //This change the directory
pgp -e test_1.txt adrian >log.txt //This is the command that encripts the file with my pubkey
and redirects the pgp messages to a log.txt
I started like this:
c:\>c:\pgp\cript.bat and everything was OK.
Then I tried to start all this from a php script:
$path = "c:/pgp/cript.bat";
exec($path,$return,$exit_code);
echo"$return<br>$exit_code";
It does'n work. The script returns $return = Array and $exit_code = 0, but it never creates the
pgp encrypted file.
I forgot to mention that my PHP is running on Win'98 toghether wirh the Apache.
Can anyone help me ?
Thanks
Adrian