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

2 Responses to “php 5.3: short_open_tag default has changed!”

[...] See more here: the bits » Blog Archive » php 5.3: short_open_tag default has changed! [...]

[...] Here is the original post: the bits » Blog Archive » php 5.3: short_open_tag default has changed! [...]

Something to say?

You must be logged in to post a comment.