Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to open an application via php and perl?
    text
    copied!<p>I am trying to print generated forms / receipts through PHP (the printers will be installed on the server, I am not attempting to print to a user's local printer). I have decided to try the following methodology:</p> <p>IN PHP:</p> <ol> <li>Generate a PDF file and save it on the server.</li> <li>Call a perl script to print said PDF file.</li> </ol> <p>IN perl:</p> <ol> <li>Use <code>system()</code> to "open" Reader and print the given PDF silently.</li> </ol> <p>What works:</p> <ul> <li>I can generate PDFs in PHP.</li> <li>I can call a perl script. <ul> <li>If the script has errors, they report to the browser window. ie: If I purposely change file paths it fails, and reports the appropriate reason.</li> </ul></li> <li>functions such as <code>printf</code> seem to work fine as the output displays in the browser.</li> <li>The exact same perl script (with the "non-functioning" line mentioned below) works properly when executed from the command line or the IDE.</li> </ul> <p>What doesn't work:</p> <ul> <li>In perl: <code>system('"C:\\Program Files (x86)\\Adobe\\Reader 10.0\\Reader\\AcroRd32.exe" /N /T "C:\\test.pdf" 0-XEROX');</code></li> </ul> <p>What happens:</p> <ul> <li>NOTHING! I get no errors. It just flat out refuses to open Adobe Reader. All code below this line seems to run fine. It's like the function is being ignored. I am at a loss as to why, but I did try a few things.</li> </ul> <p>What I've tried:</p> <ul> <li>Changed permissions of the AcroRd32.exe to <code>Everyone - Full Control</code>.</li> <li>Output the <code>$?</code> after the <code>system()</code> call. It is <code>1</code>, but I don't know what <code>1</code> means in this case.</li> <li>Verified that there are no <code>disable_functions</code> listed in php (though I think this is unrelated as <code>shell_exec</code> seems to be working, since some of the perl code is ran).</li> <li>Various other configurations that at least got me to the point where I can confirm that PHP is in fact calling the perl script, it just isn't running the <code>system()</code> call.</li> </ul> <p>Other info:</p> <ul> <li>Apache 2.2.1.7</li> <li>PHP 5.35</li> <li>Perl 5.12.3 built for MSWin32-x86-multi-thread</li> <li>WampServer 2.1</li> </ul> <p>I'm at a loss here, and while it seems like this is an Apache / permissions problem, I cannot be sure. My experience with Apache is limited, and most of what I find online is linux commands that don't work in my environment.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload