Forum


Replies: 1   Views: 412
Unable to install and get working pdf conversion
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by dev@allsaveduk.com  · 14-07-2021 - 11:05

I am trying to install phpdocx and convert a PDF, using Libreoffice 

Check.php file: 

PHP_VERSION: 7.4.21
PHP_OS: Linux
PHP_UNAME: Linux blessed-iceberg 5.4.0-1009-aws #9-Ubuntu SMP Sun Apr 12 19:46:01 UTC 2020 x86_64
SERVER_NAME: app.allsavedconsole.com
SERVER_SOFTWARE: nginx/1.20.1
SERVER_ADDR: 10.0.1.13
SERVER_PROTOCOL: HTTP/2.0
HTTP_HOST: app.allsavedconsole.com
HTTP_X_FORWARDED_FOR: 
PHP_SELF: /index.php
ZipArchive: 1
DomDocument: 1
SimpleXMLElement: 1
Tidy: 
mbstring: 1
getenv: /home/forge
getcwd(): /home/forge/app.allsavedconsole.com/releases/20210714100300/public

checkConversion.php

OK libreoffice is set as transform method in config/phpdocxconfig.ini
OK libreoffice path is set in config/phpdocxconfig.ini
OK libreoffice main executable has been found
OK HOME environment variable is set for the current user and has the following value: /home
Warning The .config/libreoffice folder in the HOME folder must have rw access.

I can't seem to get the check to pass dispite the folder having the correct settings, /home/forge/.config:

drwxrwxrwx  3 forge forge 4096 Jul 13 15:13 libreoffice

 

When I run the sample_1.php i get: 

PHP Warning:  rename(./transformDocument_libreoffice_1.pdf,transformDocument_libreoffice_1.pdf): No such file or directory in /home/forge/app.allsavedconsole.com/releases/20210714100300/phpdocx-package/Classes/Phpdocx/Transform/TransformDocAdvLibreOffice.php on line 187

Warning: rename(./transformDocument_libreoffice_1.pdf,transformDocument_libreoffice_1.pdf): No such file or directory in /home/forge/app.allsavedconsole.com/releases/20210714100300/phpdocx-package/Classes/Phpdocx/Transform/TransformDocAdvLibreOffice.php on line 187

 

Posted by admin  · 14-07-2021 - 11:19

Hello,

From the information you have sent we have found the following line:

OK HOME environment variable issetfor the currentuserand has the following value: /home

If the HOME var in the web server:

<?php
echo getenv("HOME");

is set to /home, then you need to create /home/.config folder with rw access. That seems the problem and the reason of the warning:

Warning The .config/libreoffice folder in the HOME folder must have rw access.

If needed, you can change the HOME folder instead of using the default one with the homeFolder option:

$docx->transformDocument('document.docx', 'output.pdf', 'libreoffice', array('homeFolder' => '/home/forge'));

or in config/phpdocxconfig.ini file (home_folder option).

Please also check the documentation available on the following page:

https://www.phpdocx.com/documentation/conversion-plugin/debugging-libreoffice

to debug it. As explained on the previous page, first check that LibreOffice can work standalone and then using PHP CLI mode.

If you send to contact[at]phpdocx.com SSH access to your server, the path where phpdocx is installed and a URL to test it using a web browser, the dev team will connect to check it.

Regards.