Forum


Replies: 2   Views: 669
Error while trying to open the (base) template as a zip file
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 tangamampilia  · 07-07-2023 - 16:21

Hi,

I'm considering purchasing PHPDocx due the lack of support of a open source library. For the evaluation I downloaded the trial version and tried the following:

$path = app_path('/cfiles/TemplateBlocks_symbols.docx');
                
if (!file_exists($path)) {
        echo 'File doesn\'t exists';
        die();
}
                
if (!extension_loaded('zip')) { 
        echo 'No zip extension available';
        die();  
}
                 
require_once(app_path('/PHPDocx/CreateDocx.php'));
$docs = new \CreateDocxFromTemplate($path);

 

As you can see, I'm verifiying both the file path and the zip extension enabled. Also I added one of the sample files, but the script keep poping the error "Error while trying to open the (base) template as a zip file". Not sure if there anything else I can do. The PHP version is 8.

Can you help me? Basically I'm interested in the "list" feature.

Thanks!