Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set short tag(<?) in PHP?

Tags:

php

I am using WAMPP for PHP server and in programming short tag use create a problem. I knew that it possible by change something in php.ini file but I don't know the setting for that please help me for that.

example:

<? echo "hi"; ?> //error....want to allow this also.
<?php echo "hi"; ?> //ok

I found this in PHP config setting file but what changes require I don't know...

; short_open_tag
;   Default Value: On
;   Development Value: Off
;   Production Value: Off
like image 677
Ashvin Avatar asked Jan 10 '11 10:01

Ashvin


2 Answers

In your php.ini change the short_open_tag = Off if it's there to this:

short_open_tag = On
like image 124
Diablo Avatar answered Oct 16 '22 17:10

Diablo


Click on your wamp icon then "PHP". Then click on "PHP Settings". There should be an option for "short open tag" which you should enable by clicking on it, it should show a check mark. Your wamp server will automatically restart in a few seconds and then short open tag will be enabled.

For non-wamp you need to go to your php.ini file and uncomment short_open_tag = On

like image 44
Hafiz Avatar answered Oct 16 '22 16:10

Hafiz