Replies: 6   Views: 3776
Error generating pdf file from docx
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  · 04-11-2018 - 07:48

Using AWS Elastic Beanstalk. System creates .docx perfect. But it fails during the conversion to pdf.

This is the error thrown:

rename(/var/app/current/storage/app/public/360lf_5bdea34a19f20.pdf,/var/app/current/storage/app/public/360lf_5bdea34a19f20.pdf): No such file or directory

I also followed the list of steps for debugging and pdf is created from CLI, but it doesn't in Apache. I created .config folder in /home/ec2-user and /var/app/current (just testing wich one you refer as home), with no success.

Is there any other way to fix it?


Posted by admin  · 04-11-2018 - 10:07


As it's working using PHP CLI mode, we recommend you to get the correct HOME path of Apache user:

echo getenv("HOME");

or set a custom HOME path, for example to /var/www and create the .config folder:

$ mkdir /var/www/.config


And set 777 access to the .config folder and all its subdirectories

$ chmod 777 -r /var/www/.config

And also check your server logs to find any issue when doing the conversion or some PHP or Apache configuration is blocking the conversion.

On and you can read about common issues when working with the conversion plugin.


Posted by  · 04-11-2018 - 16:48

I did everything as you suggested, and still got same error:

In the following image you can see .config file was created with the proper permission in the document root folder, in this case, for Laravel + Elastic Beanstalk, that folder is: /var/app/current/public

Posted by admin  · 04-11-2018 - 18:12


Sorry, but we don't know what could be wrong in the server setup. As it's working using the PHP CLI mode, some Apache or PHP configuration or some missing rw access may be blocking the conversion.

We recommend you to enable the debug option ( and check your server logs to find the source of the problem. Also, check if some external tool such as SELinux or similar is enabled.


Posted by  · 05-11-2018 - 00:53

This are my system variables got after running check.php

OK PHP version is 7.2.5
OK Zip support is enabled.
OK DOM support is enabled.
OK XML support is enabled.
OK Tidy support is enabled.
OK mbstring is enabled.

PHP_OS: Linux
PHP_UNAME: Linux ip-172-31-43-228 4.14.62-65.117.amzn1.x86_64 #1 SMP Fri Aug 10 20:03:52 UTC 2018 x86_64
PHP_SELF: check.php
ZipArchive: 1
DomDocument: 1
SimpleXMLElement: 1
Tidy: 1
mbstring: 1

Config file: 
temp_path = "/var/app/current/storage/app/public"

encode_to_UTF8 = "false"

language = "en-US"

paper_size = "A4"


value = ""


method = "libreoffice"
path = "/opt/libreoffice6.1/program/soffice"

I still need your help to solve it, since I can convert docx to pdf from CLI already, and same in localhost.



Posted by admin  · 05-11-2018 - 07:16


We are trying to help you, and as it's working with PHP CLI, we are sure the problem must come from a PHP or Apache configuration or some program such as SELinux that is blocking PHP to call the conversion plugin. Did you enable the debug option and check your server logs?

Please send to contact[at] the information to connect to your server through SSH, the path where phpdocx is installed and an URL to test it using a web browser and we'll check it.


Posted by admin  · 13-11-2018 - 08:48


After checking the server, the problem was the detailed on our first reply. To solve it, we just set a custom HOME folder


And set 777 access to the .config folder and all its subdirectories

$ chmod 777 -r /var/www/.config