$objWriter->save('helloWorld.docx');
$objWriter->save('helloWorld.docx');
то сайт в ошибку не падает.// Saving the document as OOXML file...
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007');
Template objWriter: object(PhpOffice\PhpWord\Writer\Word2007)#27 (11) {
["contentTypes":"PhpOffice\PhpWord\Writer\Word2007":private]=>
array(2) {
["default"]=>
array(0) {
}
["override"]=>
array(0) {
}
}
["relationships":"PhpOffice\PhpWord\Writer\Word2007":private]=>
array(0) {
}
["phpWord":protected]=>
object(PhpOffice\PhpWord\PhpWord)#3 (3) {
["sections":"PhpOffice\PhpWord\PhpWord":private]=>
array(1) {
[0]=>
object(PhpOffice\PhpWord\Element\Section)#12 (21) {
["container":protected]=>
string(7) "Section"
["style":"PhpOffice\PhpWord\Element\Section":private]=>
object(PhpOffice\PhpWord\Style\Section)#13 (33) {
["orientation":"PhpOffice\PhpWord\Style\Section":private]=>
string(8) "portrait"
["paper":"PhpOffice\PhpWord\Style\Section":private]=>
object(PhpOffice\PhpWord\Style\Paper)#14 (8) {
["sizes":"PhpOffice\PhpWord\Style\Paper":private]=>
array(7) {
["A3"]=>
array(3) {
[0]=>
int(297)
[1]=>
int(420)
[2]=>
string(2) "mm"
}
["A4"]=>
array(3) {
[0]=>
int(210)
[1]=>
int(297)
[2]=>
string(2) "mm"
}
["A5"]=>
array(3) {
[0]=>
int(148)
[1]=>
int(210)
[2]=>
string(2) "mm"
}
["B5"]=>
array(3) {
[0]=>
int(176)
[1]=>
int(250)
[2]=>
string(2) "mm"
}
["Folio"]=>
array(3) {
[0]=>
float(8.5)
[1]=>
int(13)
[2]=>
string(2) "in"
}
["Legal"]=>
array(3) {
[0]=>
float(8.5)
[1]=>
int(14)
[2]=>
string(2) "in"
}
["Letter"]=>
array(3) {
[0]=>
float(8.5)
[1]=>
int(11)
[2]=>
string(2) "in"
}
}
["size":"PhpOffice\PhpWord\Style\Paper":private]=>
string(2) "A4"
["width":"PhpOffice\PhpWord\Style\Paper":private]=>
float(11905.511811024)
["height":"PhpOffice\PhpWord\Style\Paper":private]=>
float(16837.795275591)
["styleName":protected]=>
NULL
["index":protected]=>
NULL
["aliases":protected]=>
array(0) {
}
["isAuto":"PhpOffice\PhpWord\Style\AbstractStyle":private]=>
bool(false)
}
["pageSizeW":"PhpOffice\PhpWord\Style\Section":private]=>
float(11905.511811024)
["pageSizeH":"PhpOffice\PhpWord\Style\Section":private]=>
float(16837.795275591)
["marginTop":"PhpOffice\PhpWord\Style\Section":private]=>
int(1440)
["marginLeft":"PhpOffice\PhpWord\Style\Section":private]=>
int(1440)
["marginRight":"PhpOffice\PhpWord\Style\Section":private]=>
int(1440)
["marginBottom":"PhpOffice\PhpWord\Style\Section":private]=>
int(1440)
["gutter":"PhpOffice\PhpWord\Style\Section":private]=>
int(0)
["headerHeight":"PhpOffice\PhpWord\Style\Section":private]=>
int(720)
["footerHeight":"PhpOffice\PhpWord\Style\Section":private]=>
int(720)
["pageNumberingStart":"PhpOffice\PhpWord\Style\Section":private]=>
NULL
["colsNum":"PhpOffice\PhpWord\Style\Section":private]=>
int(1)
["colsSpace":"PhpOffice\PhpWord\Style\Section":private]=>
int(720)
["breakType":"PhpOffice\PhpWord\Style\Section":private]=>
NULL
["lineNumbering":"PhpOffice\PhpWord\Style\Section":private]=>
NULL
["vAlign":"PhpOffice\PhpWord\Style\Section":private]=>
NULL
["borderTopSize":protected]=>
NULL
["borderTopColor":protected]=>
NULL
.......
/var/log/httpd/error_log.
/etc/php.d/20-xmlwriter.ini
Enable xmlwriter extension module
extension=xmlwriter.so