tags:

views:

123

answers:

2

Hi,

I just installed WAMP, and I can't get my <? to work. Is there a module I need to enable?

Thanks.

+14  A: 

You need to have short_open_tags enabled to use the <? open tag. But I recommend you not to use them but to use the standard open tag <?php for compatibility and portability reasons.

Gumbo
Totally agree. The short tags are nothing but trouble.
Atli
I disagree. It's a feature in PHP you can simply set in its configuration file. Makes templated PHP pages a lot less verbose as well.What about <?= $something ?>? It's the perfect shortcut for <?php echo $something ?> and much more readable.
Htbaa
I completely disagree... its not enabled by default in a standard installation. Not everyone has access or the know-how (even though the know-how is pretty minimal) to change it. Its not o much of an issue if your site is completely controlled by you at all times and will never be deployed by anyone else to any server not completely within their control (read virtual-private-server). Generally those things are not goign to be guaranteed so its to be avoided.
prodigitalson
+2  A: 
  1. Open your php.ini file.
  2. Set line: short_open_tags = 1
  3. Reload Apache.
  4. Like said above, this is not recommended, but if you're just learning and creating sample applications, that is tolerable.
PHP thinker