We are using php to call a batch file that launches a couple of applications.
We use:
pclose(popen( "start /B $command, "r" )) ;
where
command = c:\path\to\file\batchfile.bat
One of the applications has a dll that is required to function properly. The dll is in the same folder as the bat files which is also where the exe files are that are being launched.
In the bat file, the first thing we do is:
chdir C:\path\to\file\
and when we call start on the exe, we use:
start /d "C:\path\to\file\" program.exe
If I run the bat file from any random directory using console it runs fine.
If I run the bat file by double clicking it of course it runs fine.
But, if we run it using PHP it seems to not allow access to the support dll for some reason. The api we are using gives us error code -1.
I tried a quick test and renamed the dll and reran the cases that typically work(listed above). It then gave error code -7.
So, based on that, I think it knows where the dll is(based on different error code) but it's as if windows won't let it use/access the dll when initiated through php.
Has anyone seen something similar to this?
I also tried making a shortcut with "run as administrator" selected and called the shortcut from php. It did not help.
Thanks,
Ryan