0

I'm using no template engine, but I have an index.php file, which requires my "index.tpl" file. So I can divide php and html code. In the index.tpl file I can use the php short-syntax and everything works fine... I have so say: worked. I had to reinstall my server (my SD-card of the PI was broken) and now this way doesn't work anymore. The php-code in the .tpl-files isn't executed anymore.

How do I have to configure my apache, that the code gets executed? Strangely I never had this problems in any installation before.

UPDATE:

I just tested: php code in .html-files doesn't work either.

Lupurus
  • 3,618
  • 2
  • 29
  • 59

1 Answers1

3

Make sure that the PHP short opening tags <? ... ?> are enabled :

To achieve this, just set :

short_open_tag=On

In your php.ini file and then restart your Apache server.

Source

Community
  • 1
  • 1
Raphaël Vigée
  • 2,048
  • 14
  • 27
  • Thanks for your answer (the down-flag is not from me): That's not the problem, I also tried with – Lupurus Nov 15 '15 at 13:15
  • Haha, a hater ! Could you try doing a `tail /var/log/apache2/error.log` and put the result in a pastbin ? – Raphaël Vigée Nov 15 '15 at 13:17
  • omg... I don't believe it. My first try didn't work, because I testet with normal html files. Now I added in my .tpl file – Lupurus Nov 15 '15 at 13:29
  • @Lupurus .tpl files are not processed by php engine, neither .htm or .html. Try to name your templates e.g. file.tpl.php if you want to test them standalone. – clemens321 Nov 15 '15 at 13:47
  • @clemens321: Thank you. I saw that in the php5.conf. That's also the place where I had to add, that the tpl files can't be accessed directly. Thanks for your additional information! – Lupurus Nov 15 '15 at 14:34