Forum Moderators: coopster

Message Too Old, No Replies

<? vs <?php

need help

         

shortbus

12:29 am on Nov 18, 2004 (gmt 0)

10+ Year Member



I have scripts that won't work with <? blah blah?>

but will work with <?php blah blah?>

Is there some setting somewhere that makes <? == <?php

TIA

encyclo

12:38 am on Nov 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You will need to enable short tags in your php.ini file or recompile PHP with the
--enable-short-tags
option. Some more information here:

[ca3.php.net...]

However, the use of short tags is not recommended as it can interfere with processing some aspects of XML such as the prolog. This might not affect you, though. Personally, I leave the short tags disabled and use the full

<?php
- and it is easy to do a quick search/replace for existing scripts.

coopster

12:39 am on Nov 18, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, shortbus.

Your server must not be configured to process short_open_tags [php.net].

<added>
Thanks, encyclo, and good points!
</added>

Salsa

12:47 am on Nov 18, 2004 (gmt 0)

10+ Year Member



Open your php.ini file and search for "short_open_tag", then change the line to:

short_open_tag = On

Assuming you are running Apache, you will have to restart Apache for it to take effect.

shortbus

2:47 pm on Nov 18, 2004 (gmt 0)

10+ Year Member



enable short tags worked. thanks again guys.

brotherhood of LAN

2:56 pm on Nov 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



>However, the use of short tags is not recommended as it can interfere with processing some aspects of XML

Yep, had that problem myself. The <?xml ended up causing a parse error on my pages. Went back to turning short tags off.

shortbus

4:17 pm on Nov 18, 2004 (gmt 0)

10+ Year Member



I may do the no short tags thing... but I wanted to get the software installed asap.