My Code:
require_once 'PHPWord.php';
// Create a new PHPWord Object
$PHPWord = new PHPWord();
// Every element you want to append to the word document is placed in a section. So you need a section:
$section = $PHPWord->createSection();
// After creating a section, you can append elements:
$section->addText('Hello world!');
$temp_file_uri = 'test.docx';
// At least write the document to webspace:
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
$objWriter->save($temp_file_uri);
Issue Generated.
Fatal error: Uncaught exception 'Exception' with message 'Could not close zip file test.docx.' in D:\hosting\10275756\html\phpword\PHPWord\Writer\Word2007.php:158 Stack trace: #0 D:\hosting\10275756\html\phpword\index.php(35): PHPWord_Writer_Word2007->save('test.docx') #1 {main} thrown in D:\hosting\10275756\html\phpword\PHPWord\Writer\Word2007.php on line 158
URL: http://www.sritechapp.com/phpword/index.php
require_once 'PHPWord.php';
// Create a new PHPWord Object
$PHPWord = new PHPWord();
// Every element you want to append to the word document is placed in a section. So you need a section:
$section = $PHPWord->createSection();
// After creating a section, you can append elements:
$section->addText('Hello world!');
$temp_file_uri = 'test.docx';
// At least write the document to webspace:
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
$objWriter->save($temp_file_uri);
Issue Generated.
Fatal error: Uncaught exception 'Exception' with message 'Could not close zip file test.docx.' in D:\hosting\10275756\html\phpword\PHPWord\Writer\Word2007.php:158 Stack trace: #0 D:\hosting\10275756\html\phpword\index.php(35): PHPWord_Writer_Word2007->save('test.docx') #1 {main} thrown in D:\hosting\10275756\html\phpword\PHPWord\Writer\Word2007.php on line 158
URL: http://www.sritechapp.com/phpword/index.php