ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

PHP in templates not working

July 12, 2010 7:17am

Subscribe [2]
  • #1 / Jul 12, 2010 7:17am

    Ian Young

    200 posts

    I can’t seem to get PHP executing in my templates. In my particular example I have the index page in site/index (Template Group/Template) which has an include to includes/weather. I have made sure that “allow PHP” is set to “Yes” for both of them. I also have them both parsing on output.

    I’m also running just a small test to output a simple text string to see if it works with

    <?php echo 'hello'; ?>

    But that isn’t working so I know it’s more likely to be a problem with the PHP processing than the code logic.

    I am running EE version 1.6.9 full version.

    Any ideas why this wouldn’t be working? It’s probably something simple that I’ve overlooked but annoying none-the-less.

  • #2 / Jul 12, 2010 3:49pm

    Ingmar

    29245 posts

    I can’t seem to get PHP executing in my templates. In my particular example I have the index page in site/index (Template Group/Template) which has an include to includes/weather. I have made sure that “allow PHP” is set to “Yes” for both of them. I also have them both parsing on output.

    In simple cases such as yours Input or Output shouldn’t make any difference.

    But that isn’t working so I know it’s more likely to be a problem with the PHP processing than the code logic.

    Yes, it sounds that way. When you take a look at the source of the rendered page, do you see your PHP code, or nothing? It just might be a restriction of your server, of course. Are you running mod_security, by any chance?

  • #3 / Jul 21, 2010 2:51pm

    Ian Young

    200 posts

    Just a quick note to say this is now resolved. It turned out to be a PHP error elsewhere which was having an adverse affect. That’s fixed and the page is outputting as expected now.

    Thanks

  • #4 / Jul 21, 2010 3:14pm

    Ingmar

    29245 posts

    Glad to see you’re up and running. Please post again as needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases