我試圖在php腳本中編譯我的latex文件,但它不能調用xelatex
。無法通過system()執行外部程序?
在PHP腳本:
system("/usr/bin/whoami");
system("/usr/bin/xelatex foo.tex 2>&1");
輸出:
myuser
sh: 1: /usr/bin/xelatex: not found
但在我的終端:
$ /usr/bin/whoami
=> myuser
$ /usr/bin/xelatex foo.tex
This is XeTeX, Version 3.1415926-2.2-0.9995.2 (TeX Live 2009/Debian)
...(successful output)...
我運行PHP作爲myuser
,並通過system()
絕對路徑。我關閉safe_mode
。爲什麼我還不能執行外部程序?
什麼是你的PHP文件的chown和chgrp?並且還有權限 – safarov 2012-03-19 07:27:44