Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php: "short_open_tag = On" not working

Tags:

I have recently installed Win8 on my computer. Then I instaled wamp 2.2 with php 5.4 and I am unable to make short tag work.

I have already put:

"short_open_tag = On"

into the php.ini file and I am sure that apache is loading the right file because the path to "Loaded Configuration File" in phpinfo() is good.

I would be glad for any piece of advice. Thanks.

like image 559
marek_lani Avatar asked Sep 25 '12 08:09

marek_lani


2 Answers

I had the same problem recently after upgrading from PHP 5.3.18 to PHP 5.5.9..

I realized that for some reason, short_open_tag was appearing in my php.ini file twice.

If you did a find to get to that part of your php.ini file, try continuing the find to see if there is another instance.

like image 90
Lisa Avatar answered Sep 21 '22 13:09

Lisa


Set the :

asp_tags = On and short_open_tag = On 

in both the files \apache\Apache2.2.22\bin\php.ini and \bin\php\php5.4\php.ini and then restart the 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

Remember to restart your service (apache2, etc) for the edits to php.ini to take effect.

like image 21
Abdel Avatar answered Sep 21 '22 13:09

Abdel