Forum


Replies: 4   Views: 3385
Help cannot create simple doc
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 hhwebteam  · 11-08-2016 - 11:13

Hi Guys,

New to phpdocx. I have the corp version of the software and am just trying to work my way through setting up a simple document but am getting constant errors. I have this hosted locally on my mac and have followed the instructions to create a doc but keep getting the following.

Can anyone please help me. Again using OSX

 

Warning: copy(): Filename cannot be empty in /Applications/XAMPP/xamppfiles/htdocs/securesign/library/phpdocx/classes/CreateDocx.inc on line 633

Warning: ZipArchive::open(): Empty string as source in /Applications/XAMPP/xamppfiles/htdocs/securesign/library/phpdocx/classes/CreateDocx.inc on line 636

Posted by hhwebteam  · 11-08-2016 - 11:15

This what i have so far.

 

require_once 'library/phpdocx/classes/CreateDocx.inc';

$docx = new CreateDocx();
$text = 'Phpdocx. Easily create Word and PDF documents online';

$docx->addText($text);

$filename = 'tutorial_2.docx';
$docx->createDocx($filename);
 

Posted by admin  · 11-08-2016 - 11:25

Hello,

It seems your server can access your temp folder correctly.

Please run the same script using PHP CLI mode and check your server log to find any error.
In the file config/phpdocxconfig.ini you can set a custom temp path.

Regards.

Posted by hhwebteam  · 11-08-2016 - 11:33

I have never used PHP CLI mode to run the file can you point me in the right direction on how to run it from within php?

Posted by admin  · 11-08-2016 - 11:47

Hello,

You just need to run the script using a terminal and the PHP executable, for example:

$ php script.php

Regards.