Executing bash script with PHP, and input commands
<p>I`m trying to execute a bash script using PHP, but the problem is that the script needs to have some commands and informations inputed during the execution process.</p>

<p>This is what I`m using</p>

<pre><code>$old_path = getcwd();
chdir('/my/path/');
$output = shell_exec('./script.sh');
chdir($old_path);
</code></pre>

<p>The script execute OK, but I`m not able to input any option on the script.</p>