-4

I've setup a copy of a live site on my local WAMPSERVER and experience that the PHP is not being executed.

I suspect it's because of how PHP is being defined in the code, which is like: <? $i = 0; ?> and not <?php $i = 0; ?> (not sure if there's a "correct" term for this?)

This is working on the LIVE site, so im just wondering if there's an easy way for me to make <?..?> work locally without changing too much?

Wampserver PHP version is: 5.3.13

user1231561
  • 3,239
  • 6
  • 36
  • 55
  • 1
    http://stackoverflow.com/questions/2185320/how-to-enable-php-short-tags – senK Oct 15 '14 at 09:40
  • I can easily see its a dublicate and understand the votedown - just damn hard to find when you don't know it's called "short open tag" – user1231561 Oct 15 '14 at 09:42
  • 2
    Even you can google it like this **php without php tag**.So it will give something as result and then you can make out from there. – Rohil_PHPBeginner Oct 15 '14 at 09:43
  • I'll try and do some better googling next time - sometimes you dont think clear - this time surely one of them – user1231561 Oct 15 '14 at 09:56

3 Answers3

2

You have to change short_open_tag in your php.ini

short_open_tag = On

After that you have to restart the WAMP server for the changes to take effect.

Jerodev
  • 32,252
  • 11
  • 87
  • 108
1

in your php.ini enable the PHP short tags to allow.

and restart your apache server.

short_open_tag = On

It will work

Cheers!

Dharmesh Thanki
  • 420
  • 3
  • 9
0

Just edit your PHP.ini and modify the line:

short_open_tag=On

Then restart your web server.

It's not recommended however, because your code can be used only on servers allowing them.

xlecoustillier
  • 16,183
  • 14
  • 60
  • 85