How to Enable Short Open Tags in PHP

John John (304)
1 minute

Enabling short open tags gives you access to opening your PHP script with <? rather than the full <?php and also includes <?= '...' ?> as a replacement for <?php echo '...'; ?>. These are very handy if you are used mixed HTML and PHP.

PHP 4+×1

Howchoo is reader-supported. As an Amazon Associate, we may earn a small affiliate commission at no cost to you when you buy through our links.

If you are not already logged into your machine, log in (ssh if necessary) and open /etc/php.ini. If you're familiar with vi:

vi /etc/php.ini

otherwise you can use

nano /etc/php.ini

You should find a line that says short_open_tag = Off change this to:

short_open_tag = On

If the line doesn't exist just add it.

Depending on your machine restart apache. On Centos you can run:

/etc/init.d/httpd restart

On Ubuntu,

/etc/init.d/apache2 restart

After restarting apache you should be able to use short tags.

John John (304)
5 minutes

So you've started using Kubernetes secrets. At some point, you'll probably want to see the secret in plain text, either to validate it or use it in another context.