Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable PHP short tags?

I have a web application on a Linux server which starts with <?

I needed to copy this application to a windows environment and everything is working fine except that an SQL statement is being rendered differently. I don't know if this has to do with the script beginning with <?php instead of <? because I don't know from where to enable the <? from the PHP.ini so I changed it to <?php

I know that these 2 statements are supposed to mean the same but I need to test it with <? in order to ensure that the application is exactly the same. This way I can eliminate another possibility.

Thanks

like image 440
seedg Avatar asked Feb 02 '10 15:02

seedg


People also ask

Should I use PHP short tags?

Using short tags should be avoided when developing applications or libraries that are meant for redistribution, or deployment on PHP servers which are not under your control, because short tags may not be supported on the target server. For portable, redistributable code, be sure not to use short tags.

What is short open tag in PHP?

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

Set

short_open_tag=On 

in php.ini

And restart your Apache server.

like image 84
codaddict Avatar answered Oct 29 '22 22:10

codaddict