Updated server and now code wrapped in <? ?> <? ?> stopped running. How to fix?

Along the way - in general, how correct is it to write so, is it worth avoiding such a reduction?

Now in php.ini worth

 ; short_open_tag ; Default Value: On ; Development Value: Off ; Production Value: Off 

What to put up? And what does each category mean?

  • What version of php? - Vadim Prokopchuk
  • Abbreviated tags need to be included in the file php.ini - ArchDemon
  • 5.6 version version - Zhenya Vedenin
  • one
    All these lines are commented out, look below, without a semicolon - vp_arth
  • set, restarted, but still doesn't work - Zhenya Vedenin

2 answers 2

The parameter in the php.ini file that is responsible for recognizing short tags is called Short_open_tag. It must be set to On:

 short_open_tag = On 

    When PHP processes a file, it looks for opening and closing tags, such as <?php и ?> , That tell PHP when to start and finish processing code between them. This processing method allows PHP to be embedded in all kinds of different documents, since everything outside the pair of opening and closing tags will be ignored by the PHP parser.

    PHP also allows a short opening <? , however, it is undesirable to use them, as they are available only if enabled using the php.ini short_open_tag configuration directive php.ini short_open_tag (Set to On ), or if PHP has been configured with the --enable-short-tags option.

    If the file contains only PHP code, it is preferable to omit the closing tag at the end of the file. This helps to avoid adding random space characters or line breaks after the closing PHP tag, which can cause unwanted effects, since PHP starts outputting data to the buffer if the programmer does not intend to output any data at this point in the script.

    php 7.0.0 - ASP tags <%,%>, <% =, and script tags removed from PHP.

    For later versions

    5.4.0 The <?= Tag is always available, regardless of the short_open_tag setting.

    Source: php.net

    • short_open_tag; Default Value: On; Development Value: Off; Production Value: Off - Zhenya Vedenin
    • Now there is such a picture - Zhenya Vedenin