Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Programming»PHP»How to Enable Short Open Tag (short_open_tag) in PHP

    How to Enable Short Open Tag (short_open_tag) in PHP

    RahulBy RahulFebruary 22, 20151 Min ReadUpdated:September 13, 2019

    short_open_tag directive determines whether or not PHP will recognize code written between <? — ?> tags. Generally php users used <?php — ?> tags to write php code.

    Enable Short Tag in PHP

    To enable short_open_tag edit PHP configuration file “php.ini” and set following value to On. Default this value is set to Off.

     short_open_tag = On
    

    enable short open tag php

    After making above changes restart Apache service.

    Verify Short Tag in Enabled

    To verify that short tag is enabled in your PHP configuration. Create a file check.php with following content.

    [php]

    Now execute this script using the command line or access file in a web browser.

    php check.php
    

    Result if PHP Short Tag is On:

    PHP short open tag test
    

    Result if PHP short tag is Off: This will display PHP code on screen.

    <?
    echo "PHP short open tag test";
    ?>
    
    PHP short tag short_open_tag
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Get or Set default Timezone for PHP Script
    Next Article How to Increase PHP Upload Max Filesize Limit

    Related Posts

    How To Install PHP (8.1, 7.4 or 5.6) on Ubuntu 22.04

    Updated:May 9, 20223 Mins Read

    How To Install Linux, Nginx, MySQL, & PHP (LEMP Stack) on Ubuntu 22.04

    Updated:April 7, 20227 Mins Read

    How To Install LAMP Stack on Ubuntu 22.04 LTS

    Updated:April 20, 20225 Mins Read

    How To Setup Apache, PHP & MongoDB in Ubuntu & Debian

    Updated:October 8, 20213 Mins Read

    How To Install and Use PHP Composer on Debian 11

    Updated:February 16, 20224 Mins Read

    How To Install PHP (8.1, 7.4 & 5.6) on Debian 11

    Updated:February 16, 20224 Mins Read

    2 Comments

    1. Alexander on August 22, 2018 8:14 pm

      important! string number in config file is near 212

      Reply
    2. azarwp on November 5, 2017 3:55 pm

      thank you

      Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Install Sublime Text 4 on Ubuntu 22.04
    • How to Enable / disable Firewall in Windows
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.