Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8873625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:30:43+00:00 2026-06-14T18:30:43+00:00

Is it possible to enable php short-open-tag for a single script ?? The solutions

  • 0

Is it possible to enable php short-open-tag for a single script ??

The solutions that i have gone through mention adding short_open_tag=On in php.ini

or

php_value short_open_tag 1 to .htaccess

Can’t we enable them under a php script like we enable error reporting..??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:30:45+00:00Added an answer on June 14, 2026 at 6:30 pm

    TL;DR – No, those are the only two options you have.

    If you can’t do any of the mentioned methods, you will need a container script that sets the value before including the script with short open tags.

    <?php
    
    ini_set('short_open_tag', 'On');
    include 'myscript.php';
    

    This will prevent a parse error in myscript.php due to short open tags.

    The documentation isn’t very clear about this, but apparently this stopped working since PHP 4 after which it can only be changed using .htaccess or editing php.ini. This excerpt seems to imply that it might work from 5.3 onwards:

    PHP_INI_ALL in PHP 4.0.0. PHP_INI_PERDIR in PHP < 5.3.0

    But that’s not the case, as can be seen from answers of Cannot turn off short_open_tag with ini_set

    I’ve lodged a bug report for this documentation issue.

    Update

    The documentation will be updated to reflect this behaviour more explicitly:

    … it’s been PHP_INI_SYSTEM | PHP_INI_PERDIR since 4.0.1.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Removing a function at runtime in PHP I have a script that
I have a PHP script that uses GD2 to create an image. It uses
Possible Duplicate: How to enable PHP short tags ? I am using Apache Friends
Possible Duplicate: How to enable PHP short tags ? I am using php version
Possible Duplicates: Are PHP short tags acceptable to use? How to enable PHP short
Possible Duplicate: How to enable PHP short tags? Quick question how to enable: <?=something?>
Possible Duplicate: How to enable PHP short tags? Don't know how to search this
Possible Duplicate: How to enable PHP short tags? I am doing some JavaScript work
Possible Duplicate: How to enable the <? to start a PHP script from php.ini?
I have a simple PHP script that sends a message to a specified email

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.