Jump to content

Yanover

New Members
  • Posts

    2
  • Joined

  • Last visited

Yanover's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey gw1500se, thank you for your answer ! Yes, I've try to display all php error. Unfortunately, nothing is written in error.log (c:\xampp\apachelogs\error.log) To give a little more information, the problem has nothing to do with the printing process, even when trying to simply open the file, nothing happens through the browser! And if I go through the CLI, it works! Once again, the service operator is in the administrators group of the machine and no error either on the php or python side is detected. The code snippet above simply highlights the problem. The real problem occurs on an application I developed during my studies which is now in production. The Python script concerned by the problem performs some manipulation on a .pdf file passed to it. It is true that today I would certainly not proceed in this way! Thank you again for you time
  2. I am a bit desperate about this problem that I have been trying to solve for several days now. I'm trying to run a Python script from the exec() function in php. The script is called but the print job is never executed. This process has been running for several years and for no clear reason it suddenly stopped working. On my home computer, it works without any problem. In my virtual machine, nothing happens. The print() functions present in the script are well displayed by the return value received by php but the printing is not executed. The virtual machine is a test environment, in production it is also an physical machine. PHP <?php exec("py C:\xampp\htdocs\test\test.py", $out, $res); echo "<pre>"; print_r($out); echo "</pre>"; echo "<pre>"; print_r($res); echo "</pre>"; ?> PYTHON if __name__ == "__main__": try: filename = "C:/xampp/htdocs/test/test.pdf" win32api.ShellExecute(0, "print", filename, None, ".", 0) except Exception as e: print(f "An error occured during print_pdf : {e}") The two environments are approximately the same: * Build 1909 * Python 3.9.5 * Apache 2 & php > 7 * local user member of the administrators group * local user owner of the apache2 service * Same printer configured by default I'd like to point out that running the script directly from the CLI works on both machines. On the problematic machine, exec() only returns the result of print(..) I already opened a thread a few months ago about this problem but received no response. Thank you in advance.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.