Forum


Replies: 4   Views: 3383
Giving user www-data read and write permissions in the directory /var/www/.config
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 harman.devp  · 26-06-2017 - 07:59

Hi,

My client has purchased the advanced phpdocx package and I am facing some issues. I'm trying to convert my docx file (generated with phpdocx) to pdf format. Referring to the part of the docs pasted below,

1. can you please clarify whether I need to create a new .config directory in /var/www for the www-data user in order to successfully generate the pdf?

2. if i create a new .config directory in /var/www and make www-data the owner, do i need to copy the libreoffice folder into .config for everything to work as it should?

In order to fix this problem, I ended up changing TransformDocAdvLibreOffice.inc file but I dont want to change the core plugin files. Please suggest an alternative to this in TransformDocAdvLibreOffice.inc file :

passthru('export HOME=/tmp && '. $libreOfficePath . ' --invisible --convert-to ' . $extension . ' ' . $docSource . ' --outdir ' . $outdir . $outputDebug);

NOTE: I have added the part - 'export HOME=/tmp && ' 

To call LibreOffice, the server:

  • Needs to delete the possible blockage of SELinux or the blockage of the execution settings of external programs
  • Needs read and write permissions in the .config folder of the user's HOME directory

So, for example, if the user of the web server is www-data, and the HOME directory of this user is the default /var/www, then you must provide the user www-data with read and write permissions in the directory /var/www/.config.