Is it possible to execute a cgi script from php?

Viewed 431

I am trying to run a LaTeX parser from a dokuwiki website. The LaTeX parser relies on the mimetex cgi module, it is executed from a PhP script using the following command:

shell_exec('/var/www/cgi-bin/mimetex.cgi -f /var/www/html/test1.tex -e /var/www/html/test1.gif');  

However, the command is not properly executed when running the PhP script. I ran a test command such as:

shell_exec('cp test1.tex test2.tex');  

and was able to check that the file test2.tex was indeed created. I also ran the command:

/var/www/cgi-bin/mimetex.cgi -f /var/www/html/test1.tex -e /var/www/html/test1.gif

from a terminal, and it was executed without error. I also made sure that my apache server is configured so that it can execute cgi scripts following https://www.ionos.com/community/server-cloud-infrastructure/apache/enable-cgi-scripts-on-apache/

I am missing something here... but I don't see what...

0 Answers
Related