Skip to content
Advertisement

PHPWord not saving file in /tmp directory

I am trying to run PHPWord’s basic example in here on my Mac.

I am using XAMPP as app server.

I only changed the require_once part and added sys_get_temp_dir() in front of the file name because of the “ZipArchive::close(): Failure to create temporary file: Permission denied” error as same as in this question.

My index.php file is as follows:

JavaScript

However it gives no error and also not created the helloWorld.docx file. What is the reason and how can I solve that problem?

Advertisement

Answer

(1) Please try changing

JavaScript

to

JavaScript

(2) Make sure you have write permission to your current folder.

(3) Run the program and see whether the helloWorld.docx is created in your current folder

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement