Enabling PHP short tag

PHP, 2015-06-21 06:47:26 UTC

Today I am dealing with bad code. PHP short tag <? that does not run with the current standards. And the other bad thing is the HTML format is very bad. So many wrong close tags, bad HTML formatted, bad CSS and spaghetti code.

The code wrote by a senior PHP programmer. But he must realize, seniors are not enough if he does not adopt the newest technology. Now, he just senior of age, but it is very far behind in matters of new technologies.

Instead of replacing thousands of <? into <?php, I prefer to enable <? via PHP.ini

Find the php.ini file path

$ php --ini

And, the php.ini path is /etc/php5/cli/php.ini

$ sudo nano /etc/php5/cli/php.ini

Add this line;

short_open_tag = on

Share: