ncjoes / office-converter

PHP Wrapper for LibreOffice
MIT License
197 stars 75 forks source link

Undefined array key "HOME" #59

Open rabol opened 1 month ago

rabol commented 1 month ago

Hi

i got this on my test environment - a VPS:

Undefined array key "HOME"
/vendor/ncjoes/office-converter/src/OfficeConverter/OfficeConverter.php line 147

This is the code line in question:

$userInstallationDirectoryOption = "-env:UserInstallation=file://{$_SERVER['HOME']}/.config/libreoffice-profile{$randomNumber}";
rabol commented 1 month ago

maybe something like this:

ibreoffice -env:UserInstallation=file:///tmp/delete_me_{timestamp} \
            --headless \
            --convert-to pdf \
            --outdir /tmp \
            /path/to/my_file.doc

the advice itself was spotted in a long discussion to an issue on GitHub called "Parallel conversions and synchronization".