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

Having "Convertion Failure" after upgrading to 1.0.7 #63

Open
rougin opened this issue Aug 29, 2024 · 5 comments
Open

Having "Convertion Failure" after upgrading to 1.0.7 #63

rougin opened this issue Aug 29, 2024 · 5 comments

Comments

@rougin
Copy link

rougin commented Aug 29, 2024

Hello! After I upgraded this package in one of my projects to the latest version (1.0.7), it encountered an error during its conversion:

PHP Fatal error: Uncaught NcJoes\\OfficeConverter\\OfficeConverterException: Convertion Failure! Contact Server Admin:code 77 
error: javaldx failed!
Warning: failed to read path from javaldx
LibreOffice 6.4 - Fatal Error: The application cannot be started.
User installation could not be completed. in /var/www/html/vendor/ncjoes/officeconverter/src/OfficeConverter/OfficeConverter.php:284

Here is the code that I wrote below for the conversion (from .docx to `.pdf):

use NcJoes\OfficeConverter\OfficeConverter;

function print($file)
{
    $pdf = str_replace('docx', 'pdf', $file);

    (new OfficeConverter($file))->convertTo($pdf);

    unlink($file);

    return $pdf;
}

print('sample.docx');

While below is the version of LibreOffice installed in the system:

LibreOffice 6.4.7.2 40(Build:2)

I reverted it back to 1.0.5 in order to fix the issue temporarily.

@Mi-Zaft
Copy link

Mi-Zaft commented Sep 18, 2024

I have the same error.
I am using LibreOffice 7.4.7.2 40(Build:2)
I tried office-converter versions 1.0.7 and 1.0.6.

What could be wrong?

Convertion Failure! Contact Server Admin:code 77
error: javaldx failed!
Warning: failed to read path from javaldx
LibreOffice 7.4 - Fatal Error: The application cannot be started.
User installation could not be completed.

@mortalkiller
Copy link

Me too, same error here

@santaclaus21
Copy link

santaclaus21 commented Sep 23, 2024

The same problem, event if upgraded LibreOffice to last version (24.8).
error: javaldx failed!
Warning: failed to read path from javaldx

vaersion 1.0.5 is fine

@maciazek
Copy link

maciazek commented Nov 6, 2024

I've found that this error is caused by #54 commit 4558766#diff-4f562a7ee0b4476ad657a3d54946e2faedba51b3a481895cf2b8ea624d9f44b7R144-R149 lines 144-149.
As the author stated, it should be made optional and not be merged as-is. Seems that $_SERVER['HOME'] variable is a non-standard that depends on actual server configuration - for example, it can return "/var/www" instead of user's home directory. That's what caused error in my case (Debian 12 with Apache and PHP-FPM).

Hey @rougin @Mi-Zaft @mortalkiller @santaclaus21 may I ask you to try to revert this change locally in your apps and check if that fixes the problem in 1.0.7?

@rougin
Copy link
Author

rougin commented Nov 15, 2024

Hi @maciazek,

Thanks for the reply. I can confirm that reverting that line of code from the latest version fixes the issue.

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

5 participants