Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined array key "HOME" #59

Open
rabol opened this issue May 8, 2024 · 6 comments
Open

Undefined array key "HOME" #59

rabol opened this issue May 8, 2024 · 6 comments

Comments

@rabol
Copy link

rabol commented May 8, 2024

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
Copy link
Author

rabol commented May 8, 2024

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".

@swapnilsekhande
Copy link

Switch to version 1.0.5 it will resolve in new version this issue occures

@jackraymund
Copy link

Its not working due to this commit:
f6183b1
home is not set anymore on other os than windows

@OwKe
Copy link

OwKe commented Sep 18, 2024

Can confirm 1.0.5 is working but 1.0.7 is not.

@dman013
Copy link

dman013 commented Oct 3, 2024

Confirmed too, 1.0.5 is working whereas 1.0.7 is not... please add just a check before using the variable $_SERVER['HOME'] which is not set...

 if (isset($_SERVER['HOME'])) {
  $userInstallationDirectoryOption = "-env:UserInstallation=file://{$_SERVER['HOME']}/.config/libreoffice-profile{$randomNumber}";
  return "\"$this->bin\" --headless --convert-to {$outputExtension}{$this->filter} $userInstallationDirectoryOption $oriFile --outdir $outputDirectory";
}
return "\"$this->bin\" --headless --convert-to {$outputExtension}{$this->filter} $oriFile --outdir $outputDirectory";

@Thavia
Copy link

Thavia commented Nov 20, 2024

Adding HOME=/home/sail in .env file works like a charm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants