title: Generating a webpage with cgi, containing both html and php
body: <p>I'm trying to generate a webpage with cgi that contains both html and php.</p>
  
  <p>When I directly type some basic code in a file "test.php", it works fine:</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;h1&gt; Hello world! &lt;/h1&gt;
  &lt;?php phpinfo() ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>When I generate only html code with an executable file "test.cgi" (located in cgi-bin), it also works fine:</p>
  
  <pre><code>#!/bin/sh
  echo "Content-type: text/html"
  echo ""
  echo "&lt;html&gt;"
  echo "&lt;body&gt;"
  echo "&lt;h1&gt; Hello world! &lt;/h1&gt;"
  echo "&lt;html&gt;"
  echo "&lt;body&gt;"
  </code></pre>
  
  <p>But when I try to add a line of php, it doesn't work anymore:</p>
  
  <pre><code>#!/bin/sh
  echo "Content-type: text/html"
  echo ""
  echo "&lt;html&gt;"
  echo "&lt;body&gt;"
  echo "&lt;h1&gt; Hello world! &lt;/h1&gt;"
  echo "&lt;?php phpinfo() ?&gt;"
  echo "&lt;html&gt;"
  echo "&lt;body&gt;"
  </code></pre>
  
  <p>Only the html part is displayed. Any php seems to be neglected.</p>
  
  <p>Some more information:<br>
   - Ubuntu 12.04<br>
   - PHP Version 5.3.10-1ubuntu3.4<br>
   - Apache2</p>
  
  <p>Can somebody help me on this?</p>