Zen Cart Logo
Forums / Addon Templates / templates not working in IIS but working in apache?

templates not working in IIS but working in apache?

Locked

Views: 2,352

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
3 Jun 2009, 8:21 PM
#1
shaztesting avatar

shaztesting

New Zenner

Join Date:
Jun 2009
Posts:
71
Plugin Contributions:
0

templates not working in IIS but working in apache?

Hi guys,

I have done it many times on my developement xampp server with no problems, however my actual live server is on IIS6 with FastCGI.

I've installed and set up 1.38a perfectly and it works under the default template. However when i change it to ANY template, errors start showing up - some more than others.
However i can't even get the fresh install working! The index.php page only shows the logo and the following string:

get_template_dir('tpl_modules_categories_tabs.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_categories_tabs.php');*/ ?>

When i look at the html generated compared what it is meant to be it is clear that huge sections are not being generated.

I don't know what to do and how to troubleshoot it given all the development time i have done on customising the template and now the live server can't use anything apart from the default.

Any suggestions?

Thanks in advance,

shaztesting

p.s I have tried fresh zencart and theme installs many times to get the same results. I've copied over the includes file and let it copy everything accross by itself and i have also individually placed all the files to no avail.

3 Jun 2009, 9:20 PM
#2
get_em_fast avatar

get_em_fast

Totally Zenned

Join Date:
Dec 2006
Location:
Seligman, MO U.S.A.
Posts:
2,072
Plugin Contributions:
1

Re: templates not working in IIS but working in apache?

Got a URL for us?

Just without looking at your site, and looking at the code you posted, I do see a problem with it (highlighted in red):

get_template_dir('tpl_modules_categories_tabs.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_categories_tabs.php');*/ ?>
```That */ needs removed, and it's missing this in front: <?php require($template->

The page it actually comes from is:

 includes/templates/template_default/common/tpl_header.php

or:

includes/templates/YOUR_CUSTOM_TEMPLATE/common/tpl_header.php


The entire line should look like this:

<?php require($template->get_template_dir('tpl_modules_categories_tabs.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_categories_tabs.php'); ?>
My custom template has that line at 98, while the default template has it at line 102.


Hope this helps.
4 Jun 2009, 1:57 AM
#3
shaztesting avatar

shaztesting

New Zenner

Join Date:
Jun 2009
Posts:
71
Plugin Contributions:
0

Re: templates not working in IIS but working in apache?

Hi,

thanks for the suggestion but unfortunately it didn't work.

when i delete the */ from the code the only thing that changes when the html is produced is that the */ isn't there.

You can see it live at out testing sandbox server: www. store.yessolar.net.au/index.php

I've also checked that line against the original code form zen-cart-power.com and it is meant to be in there.

Just for a test I followed the same proceedure again on my apache server and it works flawlessly.

I'm thinking it might be something to do with PHP using fast cgi. Since actual php code made it into the html when you view the source.

What do you guys think?

Cheers

4 Jun 2009, 5:09 AM
#4
shaztesting avatar

shaztesting

New Zenner

Join Date:
Jun 2009
Posts:
71
Plugin Contributions:
0

Re: templates not working in IIS but working in apache?

Breakthrough - I installed the zen cart debugger and it directed me to one of the pure_green tempate files (tpl_top_nav.php) and the parse error occured on the last line of this code:

<?/*php if ($_SESSION['cart']->count_contents() != 0) { ?>
    <li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></li>
    <li><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>
<?php } */?>

I'm not sure what the template designer is doing here - is it trying to comment out some php code? Or comment conditionally?

If i delete that one bottom line the rest of the site now loads up but shows many php errors in the html.

The html code is littered with

 /*php

and

 php/*

I guess i can go through and delete all the /* and */ but that just messes up the code more.

Why does my windows server not know how to serve this template? Is the php code not valid? Is there something wrong with file permissions not allowing them to execute?

Why does my xampp server (and everyone else's server since this is a popular template) manage to show it properly (without hacking around the authors code?

I hope there is some kind of addon to php to make it render properly because it doesn't seem like a template problem.

Thanks in advance,

cheers,
shaztesting

4 Jun 2009, 7:26 AM
#5
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: templates not working in IIS but working in apache?

This is down to sloppy programming. Somebody has tried to comment out a block but inserted the commenting code into the middle of a php tag.

The "<?/php" should be "<?php /".

Why does it sometimes work? Well that's because in days gone by it was possible to use a short form of the php tag, i.e. "<?". This is now frowned upon (and officially deprecated) and will be turned off on most production servers, though servers intended for testing such as XAMPP may still have it enabled.

4 Jun 2009, 2:25 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: templates not working in IIS but working in apache?

Kuroi is correct.

4 Jun 2009, 11:04 PM
#7
shaztesting avatar

shaztesting

New Zenner

Join Date:
Jun 2009
Posts:
71
Plugin Contributions:
0

Re: templates not working in IIS but working in apache?

thankyou everyone.

you guys are legends. LEGENDS!. I'm going through and deleting all that content and it is getting fixed one file at a time :D