So, after "googling" a little, I found the imgtex, written by Koji Nakamaru, which is a fast CGI script, written in perl. What I did, was port it to PHP.
To run it, you must have a LaTeX distribution and the dvipng software both installed on the same machine which you will run the PHP script.
Here is the PHP code:
To use this code, you just have to pass the LaTeX commands through GET to the PHP. For example,
adding the following string to your URL:
The res variable sets the resolution for the generated image and the cmd specifies the LaTeX command. This way, the above URL will produce the following image: