1

I have some code that's working on my server and when I put it up to a different server (both CentOS, Apache), the includeed file doesn't execute the code. So I get the following:

Main file

<div>
    <?php
    //This does include it, but as though it were text
    include( "/var/www/mypath/file.php" );
    ?>
</div>

File.php has the following code:

<div><? php echo $someString; ?></div>

Then the main file loads like this:

<div>
    <div><? php echo $someString; ?></div>
</div>

Why wouldn't the included file's code load?

Don Rhummy
  • 24,730
  • 42
  • 175
  • 330
  • Note that with `short_open_tags` on you can do : `=$someString?>` instead of the usual echo stuff. – Loïc Apr 28 '14 at 03:12

1 Answers1

4

You probably have short_open_tags off, so

<div><? php echo $someString; ?></div>
     ^^^^^^

with the space isn't recognized as an open tag. <?php would be, but you've got <?[space]php.

Marc B
  • 356,200
  • 43
  • 426
  • 500