lszanto Posted January 1, 2007 Share Posted January 1, 2007 I was just wondering if anybody could help me to change apache/wamp so it will accept <? as the opener of php instead of <?php.thanks in advance, Luke. Quote Link to comment https://forums.phpfreaks.com/topic/32436-using/ Share on other sites More sharing options...
rolf Posted January 1, 2007 Share Posted January 1, 2007 In your php.ini you need to put: short_open_tag = OnAnd, if you're working with XML, dont forget that <?xml version="1.0"?> is going to get interpreted, so avoid confusion by using:<?= '<?xml version="1.0"?>' ?>Cheers,Jae Quote Link to comment https://forums.phpfreaks.com/topic/32436-using/#findComment-150723 Share on other sites More sharing options...
trq Posted January 2, 2007 Share Posted January 2, 2007 This is a bad idea as using <? will stop your code from working on alot of servers. Quote Link to comment https://forums.phpfreaks.com/topic/32436-using/#findComment-151377 Share on other sites More sharing options...
PFMaBiSmAd Posted January 2, 2007 Share Posted January 2, 2007 The best fix for this is to edit your files to use the <?php form. PHP.net has the following recommendation -[quote]; NOTE: Using short tags should be avoided when developing applications or; libraries that are meant for redistribution, or deployment on PHP; servers which are not under your control, because short tags may not; be supported on the target server. For portable, redistributable code,; be sure not to use short tags.[/quote]Short open tags, like register_globals, was one of the lazy-way/short-cuts that caused more problems then it was worth.If you still want or need to do this, either do what rolf suggested in the php.ini file or you can also do this with the following line in a .htaccess file -[code]php_value short_open_tag on[/code] Quote Link to comment https://forums.phpfreaks.com/topic/32436-using/#findComment-151451 Share on other sites More sharing options...
weknowtheworld Posted January 7, 2007 Share Posted January 7, 2007 Yes using short tag will create problems when you will change the server.. Hence, for good practice use full tag. :) Quote Link to comment https://forums.phpfreaks.com/topic/32436-using/#findComment-154986 Share on other sites More sharing options...
Draicone Posted January 12, 2007 Share Posted January 12, 2007 If you have problems converting, you can open all your files at once in a tabbed browsind text editor like Notepad++ and run one search and replace across all files. Quote Link to comment https://forums.phpfreaks.com/topic/32436-using/#findComment-158780 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.