0

I'm using windows 10, Xampp 5.6, php 5.6 and trying to print from php using exec function to print directly with FoxItReader.

this command works well in command line:

foxitreader /p ticket.pdf \\DESKTOP-M1EMKH4\EPSONTMT20II

but when i try to execute it from php it does not work, i think that issue is related to escaping my command. Would you help me with that ?

JPacheco
  • 73
  • 1
  • 1
  • 10
  • 1
    And how do you execute that command from PHP? – ino Jan 14 '18 at 07:23
  • because you are running the same program using a different [`SAPIs`](https://stackoverflow.com/questions/9948008/what-is-sapi-and-when-would-you-use-it) – hassan Jan 14 '18 at 07:33
  • I have found in several posts that I can execute CMD command from PHP using 'exec', 'shell_exec' and 'system', but it doesn't work. – JPacheco Feb 02 '18 at 16:33

1 Answers1

0

I have found the answer. My webserver Apache, hasn't permission to execute commands CMD like. So, in windows i went to services.msc -> Apache 2.4 -> Log On -> This Account. So then use the Administrator credentials. And that's it.

Thanks.

JPacheco
  • 73
  • 1
  • 1
  • 10