Cannot get poppler version info when executing with php on webserver
Dear Poppler Development Team,
I have the following issue. Imagine a php-driven website which is using poppler via shell execution. This means php issues a command line exec via e.g. the apache webserver.
Example:
<?php
$cmd = "pdfinfo -v";
exec($cmd,$out,$ret);
var_dump($cmd,$out,$ret);
...
Output when website is called in browser:
string(10) "pdfinfo -v" array(0) { } int(0)
The strange thing is, that the requested version info is not being returned. When I pass the path to a valid pdf file in the same manner I get the pdfinfo output back.
Example:
<?php
$cmd = "pdfinfo 123.pdf";
exec($cmd,$out,$ret);
var_dump($cmd,$out,$ret);
Output when website is called in browser:
string(20) "pdfinfo 123.pdf" array(15) { [0]=> string(22) "Creator: Writer" [1]=> string(34) "Producer: OpenOffice.org 3.4" [2]=> string(44) "CreationDate: Fri Nov 30 11:30:18 2012 CET" [3]=> string(18) "Tagged: no" [4]=> string(18) "UserProperties: no" [5]=> string(18) "Suspects: no" [6]=> string(20) "Form: none" [7]=> string(18) "JavaScript: no" [8]=> string(17) "Pages: 3" [9]=> string(18) "Encrypted: no" [10]=> string(34) "Page size: 595 x 842 pts (A4)" [11]=> string(17) "Page rot: 0" [12]=> string(27) "File size: 10714 bytes" [13]=> string(18) "Optimized: no" [14]=> string(19) "PDF version: 1.4" } int(0)
I wonder why I cannot get the version info with option "-v" back this way. On the terminal this is working fine of course.
This is obviously a super minor thing but I would nonetheless highly appreciate it, if someone could take a look at this.
Thank you very much. :)