0

I just upgraded to php5.3 and when I execute:

php myfile.php

I see the source code for myfile.php.

Any idea why this is happening? I've never seen anything like it before!

1
  • 1
    Executing sounds like he is using the php cli. So there is not server involved. Commented Oct 15, 2009 at 6:23

2 Answers 2

11

In 5.3

short_open_tag

is disabled by default. So if you use

<? ?> 

instead of

<?php ?> 

it can cause issues in the future (provided you just re enable the flag in php.ini). From what I have read they are still debating removal from 6.

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

1 Comment

I sure hope they won't remove them from 6. They are so convenient when writing templates.
3

Are you sure you didn't forget the opening PHP tag at the begining of the file ?

ie :

<?php
echo "hello, world!";

(Note I used "full" open tags ; ie "<?php", and not short open tags "<?" -- maybe you used short open tags, and those are disabled ? If I remember correctly, they are disabled by default, in PHP 5.3)

and not :

echo "hello, world!";

(If that doesn't help : can you post a short code sample that reproduces the problem ?)

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.