views:

117

answers:

2

I recently transferred one of my websites to a private server which allowed me to use mod_php 5 along with XCache. However, when I switch from PHP 5 CGI to mod_php, the PHP that is directly in my view files is not being rendered. For example, the title of my page is “”. As in you can see the unprocessed code in the HTML. Any ideas as to why this is happening?

Thanks!

A: 

I guess your templates aren't using the .php extension (you probably use .tpl or .phtml), you need to set up the correct handler in apache, so that those files get parsed by the php module.

Something like this should do the trick (only add what is missing in your apache configuration, don't copy paste everything)

 <FilesMatch "\.ph(p5?|tml)$">
        SetHandler application/x-httpd-php
 </FilesMatch>
 # and/or
 <FilesMatch "\.tpl$">
        SetHandler application/x-httpd-php
 </FilesMatch>
Lepidosteus
A: 

Any possibility you are using short-tags in your view files?

Change

<?=

to

<?php

If that is too much of a job there is a config option:

$config['rewrite_short_tags'] = TRUE;

Other than that it's hard for us to tell. Could you peraps pastie in your config file and an example of a view you have having trouble with?

Phil Sturgeon