Trouble with IIS Install

RangerRik1
Posts: 3
Joined: Wed Aug 15, 2012 4:32 pm

Trouble with IIS Install

Postby RangerRik1 » Wed Aug 15, 2012 4:40 pm

Hi -- I'm a web developer that works in a windows based CGI scripting language. I need my web application to be more mobile-device aware and I found WURFL while searching the web.

PHP is not my primary development language but I should be able to stumble through it. The web server, being windows based, is running IIS6.

When I attempt to run the examples/demo I get the following error:

Fatal error: Uncaught exception 'Exception' with message 'There is no device with ID [generic] in the loaded WURFL Data' in C:\Websites\XXXXXXXXX\WURFL-API\WURFL\CustomDeviceRepository.php:105 Stack trace: #0 C:\Websites\XXXXXXXXX\WURFL-API\WURFL\CustomDeviceRepository.php(70): WURFL_CustomDeviceRepository->getDevice('generic') #1 C:\Websites\XXXXXXXXX\WURFL-API\WURFL\CustomDeviceRepository.php(63): WURFL_CustomDeviceRepository->init() #2 C:\Websites\XXXXXXXXX\WURFL-API\WURFL\DeviceRepositoryBuilder.php(93): WURFL_CustomDeviceRepository->__construct(Object(WURFL_Storage_File), Array) #3 C:\Websites\XXXXXXXXX\WURFL-API\WURFL\WURFLManagerFactory.php(150): WURFL_DeviceRepositoryBuilder->build('C:\Websites\XXX...', NULL) #4 C:\Websites\XXXXXXXXX\WURFL-API\WURFL\WURFLManagerFactory.php(134): WURFL_WURFLManagerFactory->deviceRepository(Object(WURFL_Storage_File), Object(WURFL_UserAgentHandlerChain)) #5 C:\Websites\XXXXXXXXX\WURFL-API\WURFL\WURFLManagerFactory.php(77): WURF in C:\Websites\XXXXXXXXX\WURFL-API\WURFL\CustomDeviceRepository.php on line 105

Seems like it is not accessing the primary WURFL XML reference file... I have created write permissions to the WURFL folder and all its subfolders . I noted entries going into the cache folder when I attempt the demo.

Any idea what could be wrong? Thanks much for any assistance.

RangerRik1
Posts: 3
Joined: Wed Aug 15, 2012 4:32 pm

Re: Trouble with IIS Install

Postby RangerRik1 » Wed Aug 15, 2012 9:46 pm

Okay I've made progress.

I traced the PHP code, finding the call to the Source Data and found out the code was extracting the XML file from the ZIP archive to the system temp folder, which is defined in the OS environment as C:\WINDOWS\TEMP. Sure enough, upon inspecting that location I found a freshly unzipped XML file. I did some more digging and found the UTILS.PHP file which determines the UNZIP location and I set it to an absolute path to a TMP folder inside my WURFL root.

I then discovered $this->inputFile was being set to: C:\websites\XXXXXXXX\WURFL-API\TEMP\\wurfl.xml (extra backslash). When I eliminated the extra backslash it started its initial build of the persistence data in STORAGE. (Took longer than I expected, about 2 minutes -- but subsequent executions are immediate). I set the match_mode to accuracy and am now getting the expected results.

--Rick

kamermans
Posts: 393
Joined: Mon Jun 06, 2011 9:50 am

Re: Trouble with IIS Install

Postby kamermans » Thu Aug 16, 2012 9:55 am

Thanks for posting your findings. We will try to reproduce the problem and fix it in the next release.
Thanks,

Steve Kamerman
ScientiaMobile

Make sure you check out our WURFL Cloud, WURFL InSight and WURFL InFuze products!

RangerRik1
Posts: 3
Joined: Wed Aug 15, 2012 4:32 pm

Re: Trouble with IIS Install

Postby RangerRik1 » Thu Aug 16, 2012 8:45 pm

Sure--my pleasure. To go into detail I would say this:

1. The primary problem was the PHP code would unzip the XML file into the path of the TMP environment variable. Which at least for my windows installation (win 2003 server) was "c:\windows\temp\". In windows, these PHP scripts run under the IUSR_{compname} account. This account, by default does not have read/write permissions to this folder. In my case, however, I have previously granted IUSR read/write access to the temp folder for some other scripting I've done. So the WURFL examples/demo was able to UNZIP the XML source data file to this location... My suggestion would be to have the ZIP file "decompressed" to a relational path instead of the TMP envoriment VAR. For example: "././TEMP". My thinking is, if the IIS-windows user is getting this far, he/she has already granted IUSR read/write permissions to the WURFL root folder and all child nodes (subfolders). So unzipping to a relational temp folder under the root would have a greater chance of success.

2. Second problem was my TMP environment variable had a trailing slash (path separator), ie: "c:\windows\temp\". So the WURFL examples/demo was unable to load a read stream to the data source, ie: "c:\windows\temp\\wurfl.xml", which is an invalid path. This is what actually prevented MY configuration from working immediately. I set my PHP code to unzip to a TEMP folder inside my WURFL root folder and set the path to not include a trailing SLASH so the subsequent WURFL examples/demo PHP code was able to access the data source, ie: "c:\websites\XXXXXX\WURFL-API\WURFL\TEMP\wurfl.xml". I did this using a relational path as I mentioned above.

Using a relational path for the decompression of the ZIP archive data source would have allowed my WURFL installation to work "Right Out of the Box". Just a note for you guys to consider for the future. I'm sure us Windows-IIS people are a minority here but a simple config change to how this worked would have made a difference for me. (saved some debugging anyway) ... Thanks much for your fine product/project by the way, exactly what I was looking for!

--Rick


Who is online

Users browsing this forum: No registered users and 15 guests