ZF-6079: phtml not being processed by php

Description

Hi! I'm using WAMP server on localhost.

My folder structure looks like this: c:/wamp <- my web root (similar to quick start in the quick guide) c:/wamp/application <- contains models, controllers and views c:/wamp/library <- zend framework c:/wamp/www <- the public folder

So the issue here.. everything works great. I can access controllers and actions by changing the URL, and it will find the correct view-file. The view-files looks great.. except when I start adding PHP content in it. The PHP doesn't get processed by the server for some reason. This is only in the .phtml files, because since the index.php file works, and the bootstrap, and the respectivly controller classes. All of those works with PHP.. except the .phtml files.

The actual PHP content in .phtml files doesn't get printed on the page, however, it's visible in the sourcecode of the page(almost like an HTML comment). In the screenshots I'm providing I'm using shorttags, however, I've tried it with regular PHP tags aswell, and it doesn't work either. I've also tried editing the httpd.conf for apache and adding the application type .phtml for php applications, however the problem still persists.

Is this a bug? Even if it's not a bug in the actual framework - how can I solve it? Thanks in advance!

Comments

Screenshot 1. This is the view in the browser.

This is the view of the sourcecode of the page in the browser.

Try to remove the space in <?= $this->test to: <?=$this->test If that dcoesn't work, either enable shorttags, or go for the full syntax (: <?php echo $this->test; ?>)

Quote: In the screenshots I'm providing I'm using shorttags, however, I've tried it with regular PHP tags aswell, and it doesn't work either.

I've tried full syntax, and it doesn't work.. :/

Also using WAMP, same issue. Tried Dolf's suggestion. Worked for me. But a little disappointing and made the Quickstart, not very Quick.

By the way there are a instances of "<?" like in the // application/views/scripts/error/error.phtml line 6: <? if ('development' == $this->env): ?>
which does not follow the ZF coding standards. B.4.1. PHP Code Demarcation, "Short tags are never allowed."

By default shorttags is/are turned on afaik, so if WAMP deviates from that, you should complain with them.

Secondly, the coding standards are (again, afaik) only applicable to ZF code itself, not to views.

Well I still don't get it to work. I've turned OFF shorttags, and using the full syntax, but I still get the "<?php echo 'test'; ?>" in the view.

And as I said before, PHP IS working, otherwise I wouldn't even be able to see the page cause the reroute from index.php wouldn't work..

Maybe you need to add phtml to your extension thing in your php config. But once again; this has got nothing to do with what the issue was originally about. If you believe this is a bug, add a new issue, or look at the appropriate places for support.