How to set short_open_tag=On

Post Reply
User avatar
isscbta
Team Member
Posts: 137
Joined: Mon Jul 19, 2021 1:41 am
Has thanked: 17 times
Been thanked: 3 times

What is short_open_tag?
"short_open_tag" is a PHP configuration directive that controls whether the short form of PHP opening tags "<?" can be used instead of the standard opening tag "<?php". When "short_open_tag" is set to "On" in the PHP configuration file (php.ini), it allows the use of short tags. However, when "short_open_tag" is set to "Off", the use of short tags will result in a parse error. It is generally recommended to use the standard "<?php" tag in PHP code to ensure maximum compatibility and portability.

Steps to change this parameter on myVesta Hosting Panel:

1. Let's suppose that you are using PHP-FPM-7.4 web template (APACHE2):
In your SSH, as root, run:

Code: Select all

mcedit /etc/php/7.4/fpm/pool.d/domain.com.conf
Then:

Code: Select all

# add:
php_admin_flag[short_open_tag] = On
At the end:

Code: Select all

service php7.4-fpm restart
(in case when you use some other PHP version different than 7.4, just change 7.4 to propper version)

Tags:
Post Reply