title: Exec or Shell_exec: variables don't pass from php to the script
body: <p>I tried many tests, but my 2 variables just don't pass, while a variable set within the script is indeed passed back correctly to PHP.</p>
  
  <p>HTML/PHP code extract:</p>
  
  <pre><code>&lt;?php
  $subject = $_POST['subject'];
  $body = $_POST['body'];
  $output = null;
  exec('../scripts/my-script.sh $subject $body', $output);
  ?&gt;
  &lt;p&gt;&lt;?php echo "&lt;pre&gt;" . var_export($output, TRUE) . "&lt;/pre&gt;";?&gt;&lt;/p&gt;
  </code></pre>
  
  <p>my-script.sh:</p>
  
  <pre><code>subject=$1
  body=$2
  cd ~/scripts/
  path=`pwd`
  #
  echo "--"$path &gt;&gt; ./log.txt
  echo "--"$subject &gt;&gt; ./log.txt
  echo "--"$body &gt;&gt; ./log.txt
  #
  echo "=="$path
  echo "=="$subject
  echo "=="$body
  only $path gets written in log.txt, and passed back to php.
  The 2 other variables subject and body are empty;
  </code></pre>
  
  <p>html output:</p>
  
  <pre><code>array (
  0 =&gt; '==/home/account/scripts',
  1 =&gt; '==',
  2 =&gt; '==',
  )
  </code></pre>
  
  <p>log.txt content:</p>
  
  <pre><code>--/home/account/scripts
  --
  --
  </code></pre>
  
  <p>I tried to insert double quotes and format in different ways the variables within the exec function call, but the variables subject and body always appear empty both in log.txt and back in HTML/PHP.</p>
  
  <pre><code>exec('../scripts/my-script.sh "$subject" "$body"', $output);
  exec('../scripts/my-script.sh'.' '.$subject.' '.$body, $output);
  </code></pre>
  
  <p>Any idea very welcome !</p>