I am having an issue with running the exec command on a Windows-based PHP server.
I am attempting to convert .docx files to .pdf files using LibreOffice Portable. The revelant section of code is below:
exec('LibreOfficePortable/App/libreoffice/program/soffice.exe'
. ' --headless --convert-to pdf'
. ' C:\inetpub\wwwroot\eCaseDev\Webapp\pdfmaker\output.20.docx'
. ' --outdir C:\inetpub\wwwroot\eCaseDev\Webapp\pdfmaker');
The issue is that that the command does not complete, leaving the browser waiting indefinitely until it times out. The same command works when run directly in the Windows command prompt.
I believe the issue may be related to the permissions of the user the PHP process is run under, though I have given full permissions to all users for the executable being called (unless I have done this incorrectly).
Try with shell_exec();
It checks if the permissions are set well in: