open .phtml files displays code in browser

html, netbeans, php

Solution

Try creating a .htaccess file with the following content

AddType application/x-httpd-php .phtml
AddHandler x-httpd-php5 .phtml

If it works, you know your Server is not configured to run phtml as php by default.

Might also try `php5-script` instead of `x-httpd-php5`

Problem

I have saved my view file in netbeans IDE as .phtml. File has both php scripting and HTML5 within it. Through WAMP, when i try to open, only the coding is displayed.. Could anyone help please?? Thanks in advance...

Original source