Forum


Replies: 9   Views: 4160
Phpdocx 3.1 is not working properly after moving site to iis 8
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 PeterB  · 27-09-2014 - 16:40

I had to move a well running php application and MySQL (server as well as the database) from OSX Server to Windows 2012 R2 Essentials. A quick and easy task, on the first look. Old environment: Mac OS X Server, apache, MySQL database and server running with utf8 character set and collation New environment: Windows 2012 R2 Essentials, IIS 8 PHP 5.4 via FastCGI MySQL: both, character set and collation are set to utf8 'phpdocx/check.php' reports no errors. All tables and views needed for queries exists. Site runs basically well but when I checked the phpdocx functionality it became odd: 1. templates are used but variables stay empty when files are being created 2. Umlauts are displayed correctly (on php pages as well as in a simple query with MySQL Workbench) but converted into something cryptical when writing the directories and file names during the createDocx process. So, I am clueless. Does anybody know a way out? Thanks for your help in advance, Peter

Posted by admin  · 28-09-2014 - 11:04

Hello, Please do the same tests using the CLI mode to check it they works. Regards.

Posted by PeterB  · 28-09-2014 - 18:20

Thanks for your reply. Then the error message is "Could not open input file: D:\www\gen_auftrag_word.php?template=D:\www\phpdocx\templates\template.docx&AG=901&Datum=2014-05-05&GA=70001" and it does not create any folders or files. The user "IUSR" has read and execute access to templates folder and files, as well as read/write access for the destination folder. Peter

Posted by admin  · 29-09-2014 - 06:57

Hello, Please run one of the included examples using the CLI mode. Regards.

Posted by PeterB  · 29-09-2014 - 15:50

That works, even with Umlauts in filenames. P.

Posted by admin  · 30-09-2014 - 07:03

Hello, Then try the same included example using the web server instead of the CLI mode. Regards.

Posted by PeterB  · 30-09-2014 - 13:06

Hello, this works. I also tried to set "encode_to_UTF8" in phpdocxconfig.ini to false but that doesn't help with Umlauts in filenames and directories. P.

Posted by admin  · 01-10-2014 - 06:36

Hello, The library seems to run correctly. Maybe you could do a quick test using Apache or other web server? Regards.

Posted by PeterB  · 01-10-2014 - 21:47

Hello, meanwhile I set up another testing environment in a virtual machine (using Windows 8, IIS 8.5, PHP 5.6, phpdocx 3.7 corporate, MySQL Community 5.6.21). It took me a while to figure out how to set the proper read/write permissions, but basically it works this way now. Problem partially solved. What's left is the problem with the Umlauts in filenames and directory names. Not for that what's shown in the browser. But when I open the folder with the generated files in it with Explorer or Finder (via smb) I find that a letter that is supposed to be an "ö" is shown as "ö" or an "Ü" becomes "Ãœ", just to give you an example. I wonder how this behavior can occur when everything ist configured to encode in UTF-8? Peter

Posted by PeterB  · 02-10-2014 - 11:24

I think that I found a solution that fixes the UTF-8 issue on Windows. Here is my code snippet: $old = umask(0); mkdir (mb_convert_encoding('files/'.$_GET['GA'] .'-'. $_GET['AG'].'-'. $_GET['DATE'].'/' .$row_RsGen['customer'] .' (commission ' . $row_RsGen['date_in'] .') - ' . $row_RsGen['nr'] .'-' . $row_RsGen['year_nr'] . ' - '. $row_RsGen['name1'] .', ' . $row_RsGen['name2'], 'iso-8859-15',0777)); umask($old); $docx->addTemplate($dir.'/'. $_GET['template']); $docx->addTemplateVariable('NAME1', $row_RsGen['name1']); $docx->addTemplateVariable('NAME2', $row_RsGen['name2']); (...) $old = umask(0); $docx->createDocx(mb_convert_encoding('files/'.$_GET['GA'] .'-'. $_GET['AG'].'-'. $_GET['DATE'].'/' .$row_RsGen['customer'] .' (commission ' . $row_RsGen['date_in'] .') - ' . $row_RsGen['nr'] .'-' . $row_RsGen['year_nr'] . ' - '. $row_RsGen['name1'] .', ' . $row_RsGen['name2'].'/'.$row_RsGen['bez_doc'].'_CF_'.$row_RsGen['nr'].'-'.$row_RsGen['year_nr'].'', 'iso-8859-15',0777)); umask($old); So, I hope this will work on the designated real server as well. Peter