phpphp-shorttags

php have some rules with the open tag <? ?>?


I have an application that has some PHP code, the PHP open/close tag I'm using is:

<? 
        $anything;
        echo problem;

?>

The application is not running.

Are there some rules for this type of open/close ( maybe a php.ini config.) that might cause the application not to run ?

P.S. Would the better way be to change all <? to <?php ?


Solution

  • run a phpinfo(), look for the path which php.ini is used. Then open the file and find short_open_tag

    Set it to on or off.

    But in general.. use <?php ?> this is better.