{"id":15812,"date":"2026-06-18T17:49:35","date_gmt":"2026-06-18T16:49:35","guid":{"rendered":"https:\/\/da-manager.com\/blog\/how-to-enable-php-short-tags-on-your-hosting-account\/"},"modified":"2026-06-18T17:49:35","modified_gmt":"2026-06-18T16:49:35","slug":"how-to-enable-php-short-tags-on-your-hosting-account","status":"publish","type":"post","link":"https:\/\/da-manager.com\/blog\/how-to-enable-php-short-tags-on-your-hosting-account\/","title":{"rendered":"How to Enable PHP Short Tags on Your Hosting Account"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/da-manager.com\/blog\/how-to-enable-php-short-tags-on-your-hosting-account\/#How_to_Enable_PHP_Short_Tags_on_Your_Hosting_Account\" >How to Enable PHP Short Tags on Your Hosting Account<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/da-manager.com\/blog\/how-to-enable-php-short-tags-on-your-hosting-account\/#What_Are_PHP_Short_Tags\" >What Are PHP Short Tags?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/da-manager.com\/blog\/how-to-enable-php-short-tags-on-your-hosting-account\/#Why_PHP_Short_Tags_Are_Disabled_by_Default\" >Why PHP Short Tags Are Disabled by Default<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/da-manager.com\/blog\/how-to-enable-php-short-tags-on-your-hosting-account\/#How_to_Check_Whether_PHP_Short_Tags_Are_Currently_Enabled\" >How to Check Whether PHP Short Tags Are Currently Enabled<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/da-manager.com\/blog\/how-to-enable-php-short-tags-on-your-hosting-account\/#Using_phpinfo\" >Using phpinfo()<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/da-manager.com\/blog\/how-to-enable-php-short-tags-on-your-hosting-account\/#Methods_to_Enable_PHP_Short_Tags_on_Your_Hosting_Account\" >Methods to Enable PHP Short Tags on Your Hosting Account<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/da-manager.com\/blog\/how-to-enable-php-short-tags-on-your-hosting-account\/#Method_1_Editing_the_phpini_File\" >Method 1: Editing the php.ini File<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/da-manager.com\/blog\/how-to-enable-php-short-tags-on-your-hosting-account\/#Method_2_Using_the_htaccess_File\" >Method 2: Using the .htaccess File<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/da-manager.com\/blog\/how-to-enable-php-short-tags-on-your-hosting-account\/#Method_3_Using_the_Hosting_Control_Panel\" >Method 3: Using the Hosting Control Panel<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/da-manager.com\/blog\/how-to-enable-php-short-tags-on-your-hosting-account\/#Method_4_Contacting_Your_Hosting_Provider\" >Method 4: Contacting Your Hosting Provider<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/da-manager.com\/blog\/how-to-enable-php-short-tags-on-your-hosting-account\/#Important_Considerations_Before_Enabling_PHP_Short_Tags\" >Important Considerations Before Enabling PHP Short Tags<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/da-manager.com\/blog\/how-to-enable-php-short-tags-on-your-hosting-account\/#Compatibility_with_Modern_PHP\" >Compatibility with Modern PHP<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/da-manager.com\/blog\/how-to-enable-php-short-tags-on-your-hosting-account\/#Security_Implications\" >Security Implications<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/da-manager.com\/blog\/how-to-enable-php-short-tags-on-your-hosting-account\/#Testing_After_Changes\" >Testing After Changes<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/da-manager.com\/blog\/how-to-enable-php-short-tags-on-your-hosting-account\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<p><html><br \/>\n<head><br \/>\n<title>How to Enable PHP Short Tags on Your Hosting Account<\/title><br \/>\n<\/head><br \/>\n<body><\/p>\n<h1><span class=\"ez-toc-section\" id=\"How_to_Enable_PHP_Short_Tags_on_Your_Hosting_Account\"><\/span>How to Enable PHP Short Tags on Your Hosting Account<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p>If you have ever worked with legacy PHP applications or older content management systems, there is a good chance you have come across PHP short tags. These are the abbreviated versions of the standard PHP opening tag, and whilst they can make code look cleaner and more concise, they are not always enabled by default on hosting accounts. In this guide, we will walk you through everything you need to know about PHP short tags hosting, including what they are, why they matter, and how to enable them across different hosting environments.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"What_Are_PHP_Short_Tags\"><\/span>What Are PHP Short Tags?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In standard PHP, code blocks are opened with <code>&lt;?php<\/code> and closed with <code>?&gt;<\/code>. PHP short tags allow developers to use a shortened version of the opening tag, specifically <code>&lt;?<\/code> instead of <code>&lt;?php<\/code>. There is also an echo short tag, <code>&lt;?=<\/code>, which is used as a shorthand for <code>&lt;?php echo<\/code>.<\/p>\n<p>For example, instead of writing:<\/p>\n<p><code>&lt;?php echo $variable; ?&gt;<\/code><\/p>\n<p>You could write:<\/p>\n<p><code>&lt;?= $variable; ?&gt;<\/code><\/p>\n<p>The echo short tag (<code>&lt;?=<\/code>) has actually been enabled by default since PHP 5.4, regardless of the <code>short_open_tag<\/code> setting. However, the plain <code>&lt;?<\/code> short tag still requires explicit activation in the PHP configuration.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Why_PHP_Short_Tags_Are_Disabled_by_Default\"><\/span>Why PHP Short Tags Are Disabled by Default<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The main reason hosting providers tend to disable PHP short tags is to avoid conflicts with XML declarations. XML documents begin with <code>&lt;?xml<\/code>, which closely resembles a PHP short tag. If short tags are enabled and PHP encounters an XML declaration, it may attempt to parse it as PHP code, causing errors and broken pages.<\/p>\n<p>Additionally, the PHP documentation itself has historically discouraged the use of short tags for portability reasons. If you are writing code that needs to run on multiple servers with varying configurations, relying on short tags could lead to unexpected failures. That said, many existing applications and templates still use them, which is why knowing how to manage PHP short tags hosting settings remains an important skill.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_to_Check_Whether_PHP_Short_Tags_Are_Currently_Enabled\"><\/span>How to Check Whether PHP Short Tags Are Currently Enabled<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Before making any changes, it is worth confirming whether short tags are already active on your hosting account. The simplest way to do this is by creating a PHP info file.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Using_phpinfo\"><\/span>Using phpinfo()<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Create a new file called <code>phpinfo.php<\/code> in your web root directory and add the following code:<\/p>\n<p><code>&lt;?php phpinfo(); ?&gt;<\/code><\/p>\n<p>Upload the file to your server and visit it in your browser. Search for <code>short_open_tag<\/code> in the output. If it shows <code>On<\/code>, short tags are already enabled. If it shows <code>Off<\/code>, you will need to enable them using one of the methods described below. Remember to delete this file after checking, as it exposes sensitive server information.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Methods_to_Enable_PHP_Short_Tags_on_Your_Hosting_Account\"><\/span>Methods to Enable PHP Short Tags on Your Hosting Account<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>There are several ways to enable PHP short tags, depending on the level of access you have to your hosting environment. Below, we cover the most common approaches.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Method_1_Editing_the_phpini_File\"><\/span>Method 1: Editing the php.ini File<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The most direct way to enable PHP short tags is by editing your <code>php.ini<\/code> configuration file. This is the master configuration file for PHP on your server.<\/p>\n<p>Log in to your hosting control panel and navigate to the File Manager, or connect via FTP. Look for the <code>php.ini<\/code> file in your root directory. If one does not exist, you can create a new one. Add or update the following line:<\/p>\n<p><code>short_open_tag = On<\/code><\/p>\n<p>Save the file and restart your web server if you have the ability to do so. On shared hosting, changes typically take effect automatically or after a short delay. Verify the change by revisiting your <code>phpinfo.php<\/code> file.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Method_2_Using_the_htaccess_File\"><\/span>Method 2: Using the .htaccess File<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>If you are on a shared hosting account that uses Apache, you may be able to enable PHP short tags through your <code>.htaccess<\/code> file. This method works when the hosting provider allows PHP settings to be overridden at the directory level.<\/p>\n<p>Open or create the <code>.htaccess<\/code> file in your web root and add the following line:<\/p>\n<p><code>php_value short_open_tag 1<\/code><\/p>\n<p>Save the file and test your site. Note that this method will not work on all hosting accounts, particularly those using PHP-FPM or FastCGI, as these configurations often restrict <code>.htaccess<\/code> overrides for PHP settings.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Method_3_Using_the_Hosting_Control_Panel\"><\/span>Method 3: Using the Hosting Control Panel<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Many modern hosting control panels, including cPanel and Plesk, provide a graphical interface for managing PHP settings. This is often the easiest route for those who are not comfortable editing configuration files manually.<\/p>\n<p>In cPanel, look for the <strong>MultiPHP INI Editor<\/strong> under the Software section. Select the domain or directory you want to configure, then locate the <code>short_open_tag<\/code> option and toggle it on. Save your changes and verify using the phpinfo method described earlier.<\/p>\n<p>In Plesk, navigate to <strong>Domains<\/strong>, select your domain, and click on <strong>PHP Settings<\/strong>. From there, you can search for and enable the short open tag directive.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Method_4_Contacting_Your_Hosting_Provider\"><\/span>Method 4: Contacting Your Hosting Provider<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>If none of the above methods work, or if you do not have sufficient permissions to modify PHP settings yourself, your best option is to contact your hosting provider&#8217;s support team directly. Explain that you need the <code>short_open_tag<\/code> directive enabled for your account. Most reputable hosting companies will be able to assist you promptly.<\/p>\n<p>For more helpful guides on managing your hosting environment, visit the <a href=\"https:\/\/da-manager.com\/blog\" target=\"_blank\">DA Manager Blog<\/a>, where you will find a range of tutorials covering everything from server configuration to domain management.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Important_Considerations_Before_Enabling_PHP_Short_Tags\"><\/span>Important Considerations Before Enabling PHP Short Tags<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"Compatibility_with_Modern_PHP\"><\/span>Compatibility with Modern PHP<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Whilst enabling short tags can solve immediate compatibility issues with older scripts, it is worth noting that modern PHP development best practices discourage their use. If you are building a new application or updating an existing one, consider refactoring the code to use full PHP tags. This will make your code more portable and future-proof.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Security_Implications\"><\/span>Security Implications<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Enabling PHP short tags does not introduce direct security vulnerabilities, but it does add another layer of complexity to your server configuration. Keeping your PHP configuration as clean and standard as possible reduces the risk of unexpected behaviour and makes troubleshooting easier.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Testing_After_Changes\"><\/span>Testing After Changes<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Whenever you modify PHP configuration settings, always test your website thoroughly afterwards. Check key pages, forms, and any dynamic functionality to ensure nothing has broken as a result of the change.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Understanding how to manage PHP short tags hosting settings is a valuable skill for anyone running PHP-based websites or applications. Whether you are maintaining a legacy system or simply trying to get an older script running correctly, the methods outlined in this guide should help you get things working smoothly. Always remember to document any changes you make to your server configuration, and test thoroughly after each modification to ensure your site continues to function as expected.<\/p>\n<p><\/body><br \/>\n<\/html><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Enable PHP Short Tags on Your Hosting Account<\/p>\n<p>How to Enable PHP Short Tags on Your Hosting Account<\/p>\n<p>If you have ever worked with legacy PHP applications or older content management systems, there is a good chance you have come across PHP short tags. These are the abbreviated versions of <\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","_mbp_gutenberg_autopost":false,"footnotes":""},"categories":[147],"tags":[],"class_list":["post-15812","post","type-post","status-publish","format-standard","category-general"],"modified_by":null,"_links":{"self":[{"href":"https:\/\/da-manager.com\/blog\/wp-json\/wp\/v2\/posts\/15812","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/da-manager.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/da-manager.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/da-manager.com\/blog\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/da-manager.com\/blog\/wp-json\/wp\/v2\/comments?post=15812"}],"version-history":[{"count":0,"href":"https:\/\/da-manager.com\/blog\/wp-json\/wp\/v2\/posts\/15812\/revisions"}],"wp:attachment":[{"href":"https:\/\/da-manager.com\/blog\/wp-json\/wp\/v2\/media?parent=15812"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/da-manager.com\/blog\/wp-json\/wp\/v2\/categories?post=15812"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/da-manager.com\/blog\/wp-json\/wp\/v2\/tags?post=15812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}