How to execute xpdf (pdftotext.exe) on a shared drive?

im trying to XPDF pdf to text via PHP and XPDF (pdftotext.exe). Everything works fine on my local host, but when I try to move everything to the server, I get in trouble.

First of all, I checked some settings on the server, and safe_mode is turned off , exec is not disabled, and rwxrwxrwx permissions.

Then i try to execute this

 $command = "\\\\149.223.22.11\\cae\\04_Knowledge-base\\tools\\pdftotext.exe -enc UTF-8 ". $fileName . " \\\\149.223.22.11\\cae\\04_Knowledge-base\\output.txt"; $result = exec($command,$output,$args); echo shell_exec($command); 

which does not work. When I look at $result, $output, they are empty, but $ args returns 1 that matches this rule with this Windows system error code

The whole command looks like \\149.223.22.11\cae\04_Knowledge-base\tools\pdftotext.exe -enc UTF-8 \\149.223.22.11\cae\04_Knowledge-base\testpdf\04_egerland_final_paper.pdf \\149.223.22.11\cae\04_Knowledge-base\output.txt , and if entered correctly on the command line, its operation.

So I'm a little out of ideas. Someone tell me?

edit 20160201 - re-waking up So I did aditional tests, and when I try to run a similar command with exec from localhost (the target .exe file, the input and output file is in one place, only im using localhost not server), it works. Im now checks for differences in server settings. So there may be a problem that localhosts Server Api Apache 2.0 Handler and CGI / FASTCGI Server ?

+5
source share
1 answer

So it was a mistake on my side. I did not check IIS permissions well and forgot to assign the user to the virtual directory that I want to access. Therefore, my only advice and more wisdom is to double (possibly triple) the validation of all permissions.

0
source

Source: https://habr.com/ru/post/1241721/


All Articles