Page 1 of 1

How to set short_open_tag=On

Posted: Tue Mar 07, 2023 1:07 pm
by isscbta
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)