title: How to convert LaTeX to PDF/PNG by PHP
body: <p>I have <code>LaTeX</code> code inside PHP (not as .tex file); for example received by $_POST. How can I save the rendered <code>LaTeX</code> as a PNG or PDF file on my server?</p>
  
  <p><strong>EDIT:</strong> I know that PHP normally does not do this. I will run a shell command within PHP. Thus, I need something to do so in Linux terminal.</p>