Thank you very much.
This problem is solved now. By using php cli everything is working.
But now I have another problem, I can't create a docx file. Permission Problem.
Opened Via browser, using httpd/Apache.
I also set the owner of /var/www/ to apache (including subdirs)
Warning: ZipArchive::close(): Failure to create temporary file: Permission denied in /var/www/html/billing/classes/DOCXStructure.php on line 210
I don't have this problem on my localhost.
Set 0777 rights to my /tmp folder
<?php
require_once '../classes/CreateDocx.php';
$docx = new CreateDocxFromTemplate('../files/EUR_PHP.docx');
$DATE = 'test';
$INVOICE = 'test';
$AMOUNT = 'test';
$LINE1 = 'test';
$LINE2 ='test';
$docx->enableCompatibilityMode();
$variables = array('DATE' => $DATE, 'INVOICE' => $INVOICE, 'AMOUNT' => $AMOUNT, 'LINE1' => $LINE1, 'LINE2' => $LINE2);
$options = array('parseLineBreaks' => true);
$docx->replaceVariableByText($variables, $options);
$docx->createDocx($INVOICE.'.docx');
//$docx->transformDocument($INVOICE.'.docx', $INVOICE.'.pdf');
//header('Content-type:application/pdf');
//header('Content-Disposition:attachment;filename=$INVOICE".pdf"');
//readfile($INVOICE.'.pdf');
//unlink($INVOICE.'.docx');
//header('Location: /billing/index.php');
?>