I don't see anything terribly wrong. My code is very similar.
I assume you have the correct paths. I notice that $crypted does not have a leading / .
Neither path has a trailing / . So your files may not be landing in the folder you expect (and you may not have write permission for that folder). For example, your code about would write a file to /path/to/input_file### (where ### is the time). Instead you may be wanting /path/to/input_file/###.
Are the paths to the input and output files different? If they are not, you might not be able to write to your output file since it may have the same name as your input file.
I also notice that there are quotes around $clear in fopen("$clear", "w+"); . But not around $crypted in fopen($crypted, "r"); . I don't know if that matters.
Using popen might be better since clear text isn't being written to disk:
$pp = popen("/usr/local/bin/pgpe -fat -r $pgp_key_array[$send_to] -o $msg_crypted","w");
fwrite($pp, $msgtext);
pclose($pp);
Instead of $time, you might want to use something like md5(uniqid(rand())) just in case two calls to this routine happen at the same time.
Just some thoughts. Let us know what happens.
Rob