title: How to compile and send result php code in python http server?
body: <p>I am wriritng HTTP server with python socket.
  I have a web page that contain PHP code like this</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
  
  &lt;?php
  echo "My first PHP script!";
  ?&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>which a want to send to client, when i send it normally the PHP file will not be compiled and only send like a string and nothing happen in browser.
  if i want to cmpile and send php code what should i do?
  i send file like this:</p>
  
  <pre><code>    with open(filename[1:]) as f:
          outputdata = f.read()
      self.request.send(bytes('\nHTTP/1.1 200 OK\n\n','utf-8'))
      for i in range(0, len(outputdata)):
          self.request.send(bytes(outputdata[i],'utf-8'))
      self.request.close()
  </code></pre>