0

I have an issue with running unoconv from my laragon PHP server.

Info: It's a somewhat older project that uses unoconv to convert docx files to pdf files. Which has worked fine for a long time in my setup. I recently switched from the thread-safe version of PHP to the non thread-safe version of PHP 7.4.32. I copied over the entire php.ini so it should be the same in that area.

When I check the phpinfo I can see that the PATH is the same for both the thread-safe version and the NTS version. Both unoconv and the office installation is in the path.

This is the command I'm running right now:

C:\Users\USER\AppData\Local\Programs\Python\Python311\python.exe C:/unoconv/unoconv.py C:/laragon/www/vak/storage/documents/doc.148.docx 2>&1

Like I said this works fine in the thread-safe version but not in the NTS version.

The error I'm getting is this:

unoconv: Cannot find a suitable office installation on your system. ERROR: Please locate your office installation and send your feedback to: http://github.com/dagwieers/unoconv/issues

I am completely lost here. thanks in advance

user3783243
  • 5,368
  • 5
  • 22
  • 41
Dylan Bos
  • 93
  • 7
  • 1
    Your code has nothing to do with PHP, because you are executing Python scripts – Justinas Jul 21 '23 at 10:12
  • Does this answer your question? [How to add doc2pdf to custom docker container](https://stackoverflow.com/questions/72746661/how-to-add-doc2pdf-to-custom-docker-container) – Justinas Jul 21 '23 at 10:14
  • The command works in shell/CLI but fails in `exec` or `shell_exec`? Please add details of how PHP relates. – user3783243 Jul 21 '23 at 10:14
  • Yes it works if I run it directly in the command line. The issue is that it doesn't work when running it from the apache server. it fails with both exec and shell_exec. I think it has something to do with permissions but I can not figure out what. It also works fine if I run the php file through the command line. It's just when running through the server – Dylan Bos Jul 21 '23 at 10:38
  • @user3783243 Sorry I forgot to tag you – Dylan Bos Jul 21 '23 at 11:10
  • @DylanBos Apache is running as the same user you are running the CLI as? – user3783243 Jul 22 '23 at 19:40
  • @user3783243 it should be, why would that be different depending on the various versions of PHP I'm using? When using 7.4.32 TS version it works, but with 7.4.32 NTS it does not. IT's the same server just a different version. – Dylan Bos Jul 24 '23 at 06:59
  • @user3783243 I just checked with the command `echo exec('whoami');` and it shows me my default windows user (I only have 1 aside from administrator). So that shouldn't be the issue, right? – Dylan Bos Jul 24 '23 at 07:03

0 Answers0