0

Possible Duplicate:
<? ?> tags not working in php 5.3.1

I am running Debian Lenny and the "official" PHP version is 5.2.? -- However, I've ran across many things that now require PHP 5.3. After some googling, I have found a site to help me force debian lenny to go to 5.3.

Now I know a lot of things will break with 5.3. I don't seem to have that problem with most of the things I use. However one major problem I have always had was that I used the shorthand method of starting php code with: <? instead of the <?php. This was never an issue in PHP 5.2.? because it accepted both.

However, in PHP 5.3.5.0 from dotdeb it seems like the php is required. I went through and replaced all <? with <?php and then replaced all <?phpphp with <?php. That seems to have taken care of any issues I had with my code, however the shortcut in third party code such as <?= does not work as <?php=. I also do not wish to run this replacement on every php file I use from here on out.

How can I get php 5.3.? to allow both the shortcut <? and <?= to be accepted and not require the php?

Community
  • 1
  • 1
ParoX
  • 5,685
  • 23
  • 81
  • 152

4 Answers4

5

You need to enable short_open_tag in php.ini.

See also: <? ?> tags not working in php 5.3.1

Community
  • 1
  • 1
Sebastian Paaske Tørholm
  • 49,493
  • 11
  • 100
  • 118
  • -1 Normally I do not downvote people answering on duplicates. But in this particular case one just has to: You **know** that there is a duplicate and you **still** answer it? – NikiC Feb 12 '11 at 14:48
  • @Gordon, @nikic: I answered, then found the duplicate afterwards. By that point, the answer seemed to be liked, so I let it be. – Sebastian Paaske Tørholm Feb 12 '11 at 14:50
2

If you don't have access to php.ini you could try using an .htaccess file:

http://php.net/manual/en/configuration.changes.php

.htaccess:

php_value short_open_tag "1"
Natalie Adams
  • 1,841
  • 22
  • 27
0

search for <?=

replace with <?php echo

dynamic
  • 46,985
  • 55
  • 154
  • 231
0

Its in the php.ini settings. If you have a webmin panel it's easy setting it up by going to others PHP config -> manage and then other settings. Else you have to do manual editing and search for manual_open_tag

Ronald
  • 106
  • 4