Short Open Tags ON but Not Working

I installed PHP 8 on a new AlmaLinux server, and in /etc/php.ini I set:

short_open_tag = On

I restart Apache, but, the code is still displaying on the screen. I made sure there’s not another short_open_tag in the ini file, and that there’s not another php.ini file on the server. It’s very strange that it’s not working. Eventually I will replace all the short tags with <?php, but, for now I just want to get a bunch of scripts running that use the short tag.

Any idea why this wouldn’t be working? Thanks!

What does a phpinfo(); statement in a .php script show for the Loaded Configuration File and the short_open_tag?

It appears that rebooting the server cleared it up, now the short open tags are working in my sccripts. How weird.

You do need to restart the webserver and/or PHP FPM whenever you make changes to php.ini for the changes to take effect.

1 Like

I did restart Apache several times, but the change wouldn’t take effect. I don’t use FPM, but, is there a way to restart PHP?

Only thing that makes sense is some kind of cacheing issue? No idea why it wouldn’t work until a server reboot. Not sure if this is something with Apache or AlmaLinux. I have a CentOS 7 server that is oddly running a slightly newer version of Apache (2.4.6). The AlmaLinux 8.6 server is running Apache 2.4.37. That’s the install that came via dnf.

No. With PHP without PHP-FPM, PHP is ran as an Apache module. Generally speaking restarting Apache should be enough in that case.