title: PHP Exec hostgator
body: <p>I have this script to execute a file on my server hostgator. I launch this script (script.php)</p>
  
  <pre><code>&lt;?php
  
  
  echo exec('whoami');
  
   if(function_exists('exec')) {
            echo "exec is enabled";
             }
  
  
  
  
  $output = array();
  
  $retval = null;
  
  echo "&lt;br&gt;SONO IN HOME  000000000000000&lt;br&gt;";
  
  echo exec('HOME=/home1/my username on hostgator/public_html/path to script/provaricevimento.php' , $output, $retval);
  
  
  
  
  
  if ($retval == 0) {
  
  echo "&lt;br&gt;Valore " . $output ."&lt;br&gt;";
  echo "&lt;br&gt;Valore 0 " . $output[0] ."&lt;br&gt;";
  echo "&lt;br&gt;Valore 1 " . $output[1] ."&lt;br&gt;";
  echo "&lt;br&gt;Valore 2 " . $output[2] ."&lt;br&gt;";
  echo "&lt;br&gt;Valore 3 " . $output[3] ."&lt;br&gt;";
  echo "&lt;br&gt;Valore 4 " . $output[4] ."&lt;br&gt;";
  echo "&lt;br&gt;Valore 5 " . $output[5] ."&lt;br&gt;";
  
  
  }   
  
  else{
  
  echo "Error issuing exec command! valore ritorno:".$retval."&lt;br&gt;";
  
  
  
  }   
  
  echo "&lt;br&gt;-----------retval :$retval ------------------&lt;br&gt;";
  print_r ($output);
  
  echo "&lt;br&gt;-----------------------------&lt;br&gt;";
  
  ?&gt;
  </code></pre>
  
  <p>and provaricevimento.php is</p>
  
  <pre><code>&lt;?php
  
  include '../connessione/conn.php';
  
  
  $data=date('l jS \of F Y h:i:s A');
  
  //$ric=$_GET['ricevimento'];
  
  //$testo=$_GET['testo'];
  
  //$url=$_GET['url'];
  //$data= date("m.d.y");
  
  
  $sql="INSERT INTO prova SET 
          testo='$testo',
          url='$ric',
          data='$data'";
  
  
  
  
  
  
  
          if (@mysql_query($sql)){
  
              echo "INSERIMENTO CON SUCCESSO: con conta : $conta e i :$i&lt;br&gt;";
  
      } else
  
      {
  
              echo "inserimento NON avvenuto".mysql_error()."&lt;br&gt;";
  
      }
  
  
  
  
  
  
  
  ?&gt;
  </code></pre>
  
  <p>All is ok, return code is 0,  but i see that the file script.php doesn't execute provaricevimento.php  ,  because the table is not update, where is the mistake?</p>