i can run both of these commands from the terminal shell and they both work just fine, but when running from the php script (encrypt.php and decrypt.php) the encrypt works and the decrypt does not.
also when running encrypt.php and decrypt.php the user that apache allows to execute these pages is the 'nobody' user which has very limited privileges. I think this is the cause for the decrypt.php script not to work.
Also I forgot to mention the encrypt.php script is owned by 'my_user' and generates the decrypt.php file based on the file and directory. But the generated decrypt.php file is owned by the 'nobody' user.
I have even taken out the decrypt function and placed it in its own file (wth 'my_user' as the owner) and then did an include in the generated php script, but still no go.
I have posted another thread about this as well but no one responded.
The question I had is if I can use something to change the user 'nobody' to 'my_user' while running my php script from the web with NO terminal access, just echo'ing a command or using a process like sessions to change the user.
I tried your suggestion in earlier testing with my script and revisited it when you posted (Thanks for the advice) but it's still not working.
The idea behind the script and its functionality is to upload a file of a specific size or less, encrypt it on my server. when some_user goes to retrieve the file, decrypt it and then download.
seems simple enough, and I have done everything else except the decryption. maybe its the code?
any other suggestions or thought will be welcomed.