i just installed the package texlive-binaries
and used a shell exec with the pdflatex
command to generate the PDF from a (La)TeX file:
shell_exec("/usr/bin/pdflatex --interaction batchmode $filename");
i know this is not what you asked for but i don't know of a php lib as complete as the already existing latex compilers.
why reinvent the wheel anyways?
Update: When you have enough space, install textlive-full
instead of texlive-binaries
. This will install all the available packages, fonts, etc. and avoid you some headache why your document renders wrong.