On 17 June 2016 at 14:16, Pavneet Arora wrote:
I am stuggling with getting ConTeXt to run from inside a php script under Apache. First off, let me say that the installation works fine from the command line as a logged in user.
Initially, I tried to do it inline:
cmd = ". /opt/context/tex/setuptex /opt/context/tex/setuptex; cd $spool_dir; context $full_input_filename"; system($cmd);
Unrelated to the problem, but ... Instead of sourcing setuptex you should just add /opt/context/tex/texm-linux64 (or whawever folder that is) to the environmental variable PATH. The setuptex script doesn't do anything else and is just a convenience script for users. In scripting you should better set PATH. You can also manually set TEXMFCACHE if you want. Not that it matters much, but I don't know why one would want the overhead of running an additional script each time. Mojca