Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable PHP short open tags via .htaccess

I’m currently running through a tutorial for a CMS system which unfortunately uses short open tags.

I’ve confirmed that my host will not allow these in their PHP config, but that they run PHP in Apache mode (as opposed to CGI). To the best of my knowledge, this should then allow me to set the short_open_tag flag to on in an .htaccess file.

However, this appears to not be working. In the root directory, I've created an .htaccess file with just the following line, but the short open tags are still being ignored.

php_flag short_open_tag on

Am I doing something wrong? If not, can anyone suggest why it may not be working? Thanks.

Note: Someone has marked this question as being answered somewhere else. Not only does the question identified not have an accepted answer, it's based around and PHP config running in CGI mode, not Apache mode.

like image 773
David Gard Avatar asked Sep 23 '13 10:09

David Gard


People also ask

What is PHP short open tag?

The <= tag is called short open tag in PHP. To use the short tags, one must have to enable it from settings in the PHP. ini file.


1 Answers

Try this

 <IfModule mod_php5.c>    php_value short_open_tag 1  </IfModule> 

This would solve the problem

like image 131
geekdev Avatar answered Oct 02 '22 02:10

geekdev