Updated: 28 September 2026 · Applies to: cPanel & WHM 138, PHP 8.1 to 8.4

PHP has two short tags:

  • <?= (short echo): <?= $name ?> is the same as <?php echo $name; ?>. It is always available and safe to use.
  • <? (short open tag): depends on the short_open_tag setting, which is off in the recommended production php.ini. Code that uses it may show up as plain text on servers where it is off.

Recommendation

Use <?php to open PHP code and <?= for short output. To fix old code, replace <? with <?php (check <?xml lines separately).

Turn short_open_tag on (only for old code)

  1. In cPanel, open Software › MultiPHP INI Editor.
  2. Choose Editor Mode and select your domain.
  3. Add short_open_tag = On and click Save.

On a VPS without cPanel, set it in php.ini (php --ini shows where) and restart PHP-FPM.

Check the current setting

Create a file with <?php var_dump(ini_get("short_open_tag")); and open it in your browser: string(1) "1" means on, an empty string means off. Delete the file afterwards.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Managed cPanel VPS

cPanel included; we handle updates, security and monitoring.

Server management

on-demand administration, hardening, migrations and monitoring.

Was this answer helpful?

Still stuck? Open a ticket