0

I am working on a local dev environment for a Drupal site we are building. I am having trouble at one last step, and that is getting PHP in Drupal to execute properly. As you see below, when I view source on the localhost page being executed in PHP the HTML markup contains PHP code that should be executed server side first. I have confirmed the DB is connected fine, and this site runs fine on our production server. How can I fix this issue?

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?= $language->language; ?>" lang="<?= $language->language; ?>">
<head profile="<?= $grddl_profile; ?>">
    <?= $head; ?>
    <title><?= $head_title; ?></title>
    <?= $styles; ?>
</head>
<body class="<?= $classes; ?>" <?= $attributes;?>>

<?= $page_top; ?>
<?= $page; ?>
<?= $page_bottom; ?>

<?= $scripts; ?>
</body>
</html>
4
  • 2
    Short tags is the first thing that comes to mind stackoverflow.com/questions/2185320/… Commented Dec 31, 2012 at 18:00
  • BOOOM!!!!!! Worked. short_open_tag=On Commented Dec 31, 2012 at 18:08
  • 2
    Glad it helped - but this is exactly the reason use of short tags is discouraged. They're not exactly portable. Commented Dec 31, 2012 at 18:09
  • 2
    You should def get rid of short tags either way Commented Dec 31, 2012 at 18:24

2 Answers 2

1

Have you enabled PHP input filter? Have you enabled short open tag in php.ini?

Sign up to request clarification or add additional context in comments.

Comments

1

You need in php.ini file edit this line from

short_open_tag = Off

to

short_open_tag = On

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.