title: Amazon EC2 not working with user data php
body: <p>I am launching a ubuntu EC2 instance with my PHP code and passing user data to it.
  I don't own that instance.. but they provide user level access to it.</p>
  
  <p>Firstly i tried to run a particular job by passing user data, but it did not seem to work.</p>
  
  <p>I made it very simple and send "touch test.txt" as user data. The instance was launched properly but the file was not created as should be i guess.</p>
  
  <p>Am I missing any step? I checked that file was not created using ssh 'ing to the instance. One thing was i was not in root user at instance. Will that effect anything?</p>
  
  <pre><code>&lt;?php
  error_reporting(-1);
  header("Content-type: text/plain; charset=utf-8");
  require_once '../sdk.class.php';
  // Instantiate the class
  $ec2 = new AmazonEC2();
  $userdata2="touch hi".".txt";
  echo $userdata2;
  $response = $ec2-&gt;run_instances('ami-5f21e236', 1, 1,
  array('KeyName' =&gt; 'radix2'),
  array('UserData' =&gt; $userdata2),
  array('InstanceType' =&gt; 'm1.small')
  );
  var_dump($response-&gt;isOK());
  ?&gt;
  </code></pre>
  
  <hr>
  
  <p>Thanks for the help Eric</p>