php 5.3: short_open_tag default has changed!

Snow Leopard Server includes an upgrade of PHP to version 5.3. This version has a changed default for the “short_open_tag” option as compared to the version that shipped in Leopard server. The difference is that short_open_tag is now disabled by default, which means that the following will not work:

<?
phpinfo();
?>

The problem is the opening <?, which is in ‘short’ form. The long / normal form of the open tag would be <?php. If you don’t feel like editing all your scripts, you can simply declare the following in your /etc/php.ini:

short_open_tag = On

To further illustrate the change, consider the following command results, produced on a Snow Leopard Server that was upgraded from Leopard:

bash-3.2# grep 'short_open' /etc/php*default*
php.ini.default:; short_open_tag
php.ini.default:short_open_tag = Off
php.ini.default-5.2-previous:short_open_tag = On
php.ini.server-default:; short_open_tag
php.ini.server-default:short_open_tag = Off

About dre

I like all kinds of food.
This entry was posted in bit bucket. Bookmark the permalink.

2 Responses to php 5.3: short_open_tag default has changed!

  1. Pingback: the bits » Blog Archive » php 5.3: short_open_tag default has changed! | Mac Affinity

  2. Pingback: the bits » Blog Archive » php 5.3: short_open_tag default has changed! | I AM OSX

Leave a Reply