0

I have set up a new Ubuntu server and installed LAMP. I've copied websites from my old Debian server to the new one but have this problem:

My tags < ? are not being processed unless I change them to < ? php (they are without spaces in the code I just couldnt write them here without the spaces in between)

My old apache server processes < ? fine. Any ideas?

Thanks.

Paul G
  • 1
  • 1
  • please include relevant code files – Nikos M. Jun 06 '15 at 11:06
  • You would need to configure your web server to execute .txt files as PHP, which isn't a great idea. Better to use the correct file extension and rename the file to menu.php – Clive Jun 06 '15 at 11:13
  • check this answer http://stackoverflow.com/questions/2185320/how-to-enable-php-short-tags – unloco Jun 06 '15 at 11:15

1 Answers1

0

Solved

I edited php.ini and found the value short_open_tag = Off and changed it to short_open_tag = On

Reloaded Apache and it worked :)

Paul G
  • 1
  • 1
  • I would recommend that you go through the process and add the 'php' to your open tags. That configuration option is for backwards compatibility, but you really shouldn't be doing it that way anymore. – Jason Miesionczek Jun 06 '15 at 11:56
  • It is not recommended to use short_open_tag=on as this can cause problems when using other tags that start with '', such as ' – Mike Stotts Jun 06 '15 at 14:51