0

I'm not sure if this question belongs here or StackOverflow...

Some time ago I wrote a web app using Zend Framework and since then it ran flawlessly on a standard shared hosting (lampp stack). I bought a VPS and set up a few sites without a problem using NGINX and PHP-FPM. I decided to migrate the mentioned site to the new server - ZF doesn't render layout or any templates. It just prints the layout.phtml file without interpreting the code in it. There aren't any errors in the logs. The version in Zend/Version.php says '1.7.1'.

The first thing that comes to mind is the version of PHP but it is 5.x - the same that was running on the shared hosting. I'm completely clueless here.

Should I upgrade to latest ZF? What would you do to debug it?

pinkeen
  • 219
  • 1
  • 9

1 Answers1

0

Your templates probably use short opening tags <? or <?=$foo versus <?php or <?php echo $foo. This is turned off by default in PHP 5.3 (possibly earlier) so you have enable it in your php.ini file.

Martin Fjordvald
  • 7,589
  • 1
  • 28
  • 35
  • I haven't touched php code for a long, long time. I've read that short opening tags are evil and I didn't use them anywhere, except for the templates, because the ZF docs said specifically that they can be used in ZF templates... Supposedly ZF parses templates in a different way than ordinary php scripts. Nevertheless, I'll check it out and post the results. – pinkeen Dec 10 '10 at 16:21
  • Thank you, It works now! But could somebody explain this to me? When I was coding this site, ZF docs explicitly stated that short tags are evil except the templates. What's more, even then, [short openings] wouldn't work by default in normal php scripts (and I didn't use them) but they did work in templates. What's changed? – pinkeen Dec 10 '10 at 16:27
  • I agree, it makes perfect sense. I feel so dumb that I forgot about this basic issue and panicked right away. I'm not a newbie but I never managed a production server before (but I have set up various stacks for development a dozen times). – pinkeen Dec 10 '10 at 16:46