1

Apache to understand

I have some code constructed at my old server

<? echo "hello world";?>

but when I migrate to new server

<? is not recognize, how do i set to recognize it as <?php

Thanks!

BUN
  • 57
  • 8

2 Answers2

1

Set

short_open_tag = on

in php.ini and restart your Apache server.

If you don't have access to the php.ini you can try to enable them trough the .htaccess file but it's possible the hosting company disabled this if you are on shared hosting:

php_value short_open_tag 1
Muhammad Hassaan
  • 7,296
  • 6
  • 30
  • 50
0

Configure php to use short tags

http://php.net/manual/en/language.basic-syntax.phptags.php

PHP also allows for short open tag <? (which is discouraged since it is only available if enabled using the short_open_tag php.ini configuration file directive, or if PHP was configured with the --enable-short-tags option).

Akhil Thayyil
  • 9,263
  • 6
  • 34
  • 48