I want to render a .phtml file through Apache, however when I try, it renders the page as text and not as html.
In my vhost configuration, if I try to render an index.php, it executes properly. But when I change the DirectoryIndex to index.phtml and try to render the index.phtml present in the public directory it just renders text.
The vhost Config is:
code
ServerName parminder.com
DocumentRoot “C:/workspace/parminder_local_net/public”
ErrorLog logs/parmindercom.log
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
DirectoryIndex index.phtml
*
What else do I need to configure for this to work? Do I need to use .htaccess?
What is the basic concept?
You need to configure Apache so it knows that you want .phtml files to be treated as PHP. See step 8 of the PHP install guide.
… but .phtml is the file extension used for PHP 2. You should probably audit them, bring them up to modern PHP coding practises and rename them to follow current conventions.