I've installed Apache 2.2 with PHP 5. On other machines, with these same versions, I've always been able to put PHP code in my web files with <? and ?>. With this installation, however, for some reason any code between <? and ?> fails to be executed by the PHP module. Only code between <?php and ?> is executed.
Why would this be, and how can I configure it so it will do as I expected?
As far as using the short_open_tag option, this has had its default set to OFF for quite a few releases now for a reason: it conflicts with the <?xml tag. Also, as you have found out, depending on it makes your scripts less portable as they become dependent on that PHP setting be set to a non-default value. If you always use the long <?php tag, you can then carry on without ever worrying about that configuration setting.
With regard to other settings, the biggest "gotcha" is old-fashioned scripts which depend upon register_globals being turned on. See http://www.php.net/register_globals for more info on what it does and why the default was changed to OFF.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Bookmarks