我安装了所需的库及其在终端中的工作,但不在我的 php 文件中。我的代码是:
$mypdf = shell_exec('/usr/local/bin/pdftotext test.pdf test.txt');
echo $mypdf;
/usr/local/bin/pdftotext test.pdf test.txt
如果我在终端中执行此命令,它工作正常。
我也写我的代码这种类型:
shell_exec('/usr/local/bin/pdftotext test.pdf test.txt');
$mypdf = file_get_contents("test.txt");
echo $mypdf;
在错误日志中,消息是:
/usr/local/bin/pdftotext: /opt/lampp/lib/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/i386-linux-gnu/libstdc++.so.6)