简体   繁体   English

从php脚本运行tex

[英]running tex from php script

I've installed mactex on my macbook and configured apache + php + mysql. 我已经在Macbook上安装了mactex并配置了apache + php + mysql。

So when I'm running texi2pdf from bash it works fine. 因此,当我从bash运行texi2pdf时,它工作正常。 But when I'm trying to run it from php script the next error occurs 但是,当我尝试从php脚本运行它时,会发生下一个错误

Font T2A/cmr/m/n/10=larm1000 at 10.0pt not loadable: Metric (TFM) file not found. 

The function is called as 该函数称为

exec("texi2pdf .... ") 

$PATH var is OK. $ PATH var可以。

I guess the problem with access to some files but I've set permission to all necessary files (including ~/Library/texlive ) and all of them are successfully read with 我猜是访问某些文件的问题,但是我已经设置了所有必需文件(包括〜/ Library / texlive )的权限,并且所有文件都可以通过读取成功

exec("ls ... ") 

or 要么

exec("cat ...") 

The problem is not with cyrillic fonts, all necessary packages are installed and as I've already said texi2pdf works fine from bash. 问题不在于西里尔字体,所有必要的软件包都已安装,正如我已经说过的那样,texi2pdf从bash可以正常工作。


MacOSX 10.7 MacOSX 10.7

Apache/2.2.19 (Unix) DAV/2 PHP/5.3.6 Apache / 2.2.19(Unix)DAV / 2 PHP / 5.3.6

TeX 3.1415926 (TeX Live 2011) TeX 3.1415926(TeX Live 2011)

Problem solved. 问题解决了。 As PHP script uses current directory (or DocumentRoot) to load and generate necessary tex fonts the home directory should be change to user home 由于PHP脚本使用当前目录(或DocumentRoot)加载并生成必要的tex字体,因此应将主目录更改为用户主目录

putenv('HOME=/Users/username');

Are you tried to allow exec? 您是否试图允许执行? It may be blocked as default. 默认情况下,它可能被阻止。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM