在ubuntu中通过PHP显示ghostscript版本号 [英] display ghostscript version number through PHP in ubuntu
本文介绍了在ubuntu中通过PHP显示ghostscript版本号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我编写了以下代码来显示ghostscript的版本号:
I have written the following code for showing the version number of ghostscript:
<html>
<head>
<title></title>
</head>
<body>
<?
$ver = shell_exec("/usr/bin/gs --version");
//$ver = exec(GS_BIN . " --version");
print "$ver";
print "A";
?>
</body>
</html>
我可以打印出 A
,但是为什么没有版本号?
I can get the A
printed, but not the version number why?
谢谢.
推荐答案
可能ghostscrsipt正在将数据写到STDERR而不是STDOUT.尝试做
Possibly ghostscrsipt is writing the data out to STDERR instead of STDOUT. Try doing
/usr/bin/gs --version 2>&1
将stderr重定向到stdout并重试
to redirect stderr to stdout and try again
这篇关于在ubuntu中通过PHP显示ghostscript版本号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文