Php: "short_open_tag = On" does not work

I recently installed Win8 on my computer. Then I installed wamp 2.2 with php 5.4 and I can not do the work with a short tag.

I have already set:

"short_open_tag = On

to the php.ini file, and I'm sure apache is loading the correct file because the path to the β€œloaded configuration file” in phpinfo() is good.

I would be happy for any advice. Thank.

+16
php
Sep 25
source share
4 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 appeared in my php.ini file twice.

If you find to get to this part of your php.ini , try continuing your search to see if there is another instance.

+43
Feb 20 '14 at 17:49
source share

Install:

 asp_tags = On and short_open_tag = On 

in both files \ apache \ Apache2.2.22 \ bin \ php.ini and \ bin \ php \ php5.4 \ php.ini, and then restart the Apache server.

If you do not have access to php.ini, you can try to enable them through the .htaccess file, but this is possible if the hosting company has disabled it if you are on a shared hosting:

 php_value short_open_tag 1 

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

+7
Sep 25 2018-12-12T00: 00Z
source share

Be sure to replace all

 short_open_tag 

in the php.ini file. In my case, there were several places where it was defined. For me, the wrong setting was located under

 ;;;;;;;;;;;;;;;;;;;; ; Language Options ; ;;;;;;;;;;;;;;;;;;;; 
+4
Nov 13 '14 at 11:50
source share

Change the value of short_open_tag to On .

And if your php.ini is in /etc/php/5.6/fpm , you need to restart the php5.6-fpm with

 sudo service php5.6-fpm restart 
+1
Aug 24 '19 at 20:52
source share