I must use ssh2_exec to install some packages on linux servers. Some of the packages require some answers when installing so I must be able to provide those answers using the ssh2_exec function from PHP. I already know the answers to those questions but it's hard to enter the response when the question is prompted. Example:
// Build command for OpenVPN
ssh2_exec ( $connection, "./build-ca" );
The above command will trigger openvpn to be configured so it asks a few questions such as:
Country Name (2 letter code) [US]:
For the above question I must answer "US" and hit enter to continue etc. Any ideas how to do this using ssh2_exec function?