隐藏PHP exec()中的命令参数

I have a script, written in C, which requires 3 parameters: host, name, password, like this:

./myscript 1.1.1.1 name mypassword

I call this using PHP exec command (need to, functionality not found in PHP).

exec('./myscript $host $name $password');

In linux, using ps command, I can see:

./myscript 1.1.1.1 name password.

How can I hide my password, that you can't see it on linux using ps?

Thank you.

There are example out there which does something you like: http://www.lenzg.net/archives/256-Basic-MySQL-Security-Providing-passwords-on-the-command-line.html Remember, your password is still visible for a fraction of time.

You could simply prompt the password after starting the executing of the C-script and forward the password via an pipe in PHP exec.

Since you are in a running environment. I'd temporary store your password in an environment variable (SET) and use this variable in your exec(). This way your password won't show up in ps.