Forum


Replies: 2   Views: 3478
Variables not replaced within template (win server 2008 / php5.5 / phpdocx 3.7)
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 Pascal  · 20-04-2015 - 14:50

Hello, In the scope of a server upgrade, I'm testing this very simple piece of code : < ? php require_once 'librairies/phpdocx_v3.7/classes/CreateDocx.inc'; require_once 'librairies/phpdocx_v3.7/classes/TransformDoc.inc'; $doc="C:\Temp\\test.docx"; $nomPage = "C:\Temp\\res_docx2"; $nomPdf = "C:\Temp\\res_docx2.pdf"; $page = new CreateDocx (); $page->addTemplate($doc); $page->addTemplateVariable('I', "okay"); $page->createDocx ( $nomPage ); ? > Basically, the "$I$" occurence are supposed to be replaced by "okay". It works fine on the former server, whose configuration is : - Windows Server 2003 - IIS 6 - php 5.2.11 (isapi interfaced) - phpdocx v3.7 But this doesn't work on the new one : - Windows Server 2008 (x64) - IIS 7.5 - php 5.5.11 (fastCGI interfaced). v5.2.11 also tested. Both 32bits versions, non TS. - phpdocx v3.7 The target docx is generated but the "$I$" is still in the doc. I cannot believe that it is a system problem... but it looks like it is ! Are there similar issues/workaround with WinServer2008 and/or FastCGI interfaced php ? Is phpdocx-v3.7 comptaible with newer version of php ? Thks, NF

Posted by admin  · 20-04-2015 - 17:18

Hello, It should work perfectly. We recommend you to test running the same scripts using the CLI mode, it may be a problem with the temp folder; and check your web server logs to find any issue or missing rw access. Regards.

Posted by Pascal  · 21-04-2015 - 09:49

Thanks for the clue, it works now. The temp folder did not have the write permissions. Nevertheless, please note that the CreateDocx::getTempDir() doesn't return the temp path defined in phpdocxconfig.ini, which is confusing... Have a good day, NF