Pages

Thursday, December 27, 2012

Thing of the day : PHP.INI short_open_tag

Working on some Web Development in Wordpress / PHP, I made the following experience today: A file was being parsed and executed correctly on one server, but showed a parse error (unexpected T_ELSE, but this could have been anything related to placement of conditional and loop markers "}").

What do you do? You double check if the file is indeed the same file. Is there a problem with FTP, encoding, etc.? And then? You noticed that you were using <? instead of <?php Then you look in PHP.INI and you find this: short_open_tag.

The default is "On" and most web hosts use this, and I was so used to using it everywhere in my code, that I really didn't see it.

However, on some packages like Wampserver this is "Off". I figure this can save someone many hours, and I'm thinking of a more structured way to contribute these kind of quircks. Any idea, anyone?

0 comments:

Post a Comment

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Lady Gaga, Salman Khan