for first mention, this question is extension to my previous question here. And my goal is still same. I have IIS7 server (where i running some PHP) on network drive (drive 1), when im trying acces another network drive (drive 2), where are need to acces PDF files with pdftotext.exe.
On drive 1 i also have a virtual/link directory (virDir) on directory (tarDir) on drive 2 when all files i need to acces are stored.
When i run pdftotext.exe by myself everything work like a charm, on drive 1 output file with pdfcontent is created and everyone lives happy till dead. But when im trying to execute PHP script, stored in drive 1 in virDir, which runs pdftotext.exe via exec command, it returns 1 and no file is created.
In my last question i figured out that it will be probably permission issue, but im bit confused how to set them. IIS7 have some internal users like IUSR and IIS_IUSRS and when i call get_current_user();
in php, its set to testUser.
So which permissions i need to set to both dirs(virDir and tarDir) so server can acces them?
I tried that testUser have set Modify, Read a Execute, List folder contents, Read, Write permissions on tarDir (drive 2), and IUSR, testUser and II_IUSRS have Read a Execute, List folder contents, Read, Write permissions on tarDir (drive 1).
When im trying to acces "normal" files, like txt, pptx, etc i can read them without problem (im using php library for it), but when i try to use pdftotext.exe it fails.
Can someone see what im doing wrong?
EDIT: So i made some other testing, and when i run this comand (im currious who is running command line)
echo "<br> who am i in command line? <br>";
$out = array();
exec('cmd /c whoami 2>&1',$out,$exitcode);
echo "<br />EXEC: ( exitcode : $exitcode )";
echo "<hr /><pre>";
print_r($out);
echo "</pre>";
Runned on drive 1 it shows that command line is runned by testUser, but when i run it in drive 1 virDir, it returns 1. So probably issue with permissions about executing commands in shell... i will apreaciaty any hint...