title: Compiling swf from php using mxmlc and "exec" - loading config file but no swf in browser
body: <p>I'm on a RedHat server, with a simple PHP page that has a form, with inputs for name, phone, and url. </p>
  
  <p>When the form is submitted, I run a command to compile a swf using mxmlc. The command is this : </p>
  
  <pre><code>$generate_command1 = "export _JAVA_OPTIONS=\"-Xms32m -Xmx64m\"; /opt/flex/bin/mxmlc -define+=NAMES::Name,\"\'$name\'\" -define+=NAMES::Phone,\"\'$phone\'\" -define+=NAMES::Website,\"\'$url\'\" -output /path/to/my/webserver/httpdocs/swfbuilder/generated.swf DynamicTextTest.as";
  
  $last_line = exec($generate_command1, $out);
  print_r($last_line);
  </code></pre>
  
  <p>The result is always : </p>
  
  <pre><code>Loading configuration file /opt/flex/frameworks/flex-config.xml
  </code></pre>
  
  <p>When I run the same command from ssh into the server, I actually get a swf generated. I.e. </p>
  
  <pre><code>Picked up _JAVA_OPTIONS: -Xms32m -Xmx64m
  Loading configuration file /opt/flex/frameworks/flex-config.xml
  /var/www/vhosts/tag.domandtom.com/httpdocs/swfbuilder/generated.swf (945 bytes)
  [root@htmlfive swfbuilder]# 
  </code></pre>
  
  <p>Both directory and files have been CHOWN'd for ownership and CHMOD'd for 775... So what am I doing wrong to get this to work from the web page? Should I have a forked process and wait until it's complete? Sleep?</p>
  
  <p>EDIT:</p>
  
  <p>I've looked into <a href="https://stackoverflow.com/questions/347969/calling-fcsh-from-php-script">fcsh</a> and other <a href="https://stackoverflow.com/questions/278868/calling-java-from-php-exec">mxmlc / java</a> related questions.</p>