2

I've just installed Apache and PHP. Apache appears to run php correctly, but it treats my php as comments when I delimit it with simply <?; it appears only to run code delimited with <?php

This is a problem for me because I am creating a development environment for a pretty sizeable website which I did not build. (Don't want to have to go through hundreds of files and change a lot of tags.)

What can I do to get it to treat all <? tags as php start tags?

Details:

Running Apache 2.2.19, PHP 5.2.17, Windows XP

To get Apache to run PHP, I added the following lines to the config file:

LoadModule php5_module "C:/Program Files/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
PHPIniDir "C:/Program Files/php"
JellicleCat
  • 28,480
  • 24
  • 109
  • 162
  • Additional reading (one of the arguments is for the very reason this question was created): http://stackoverflow.com/questions/200640/are-php-short-tags-acceptable-to-use – Mike B Jul 27 '11 at 17:43

4 Answers4

8

Check your php.ini. Make sure short_open_tag is set properly (i.e., you want it to be set to On).

NickAldwin
  • 11,584
  • 12
  • 52
  • 67
4

This is a php configuration question. You just need to set

short_open_tag = On
markus
  • 40,136
  • 23
  • 97
  • 142
0

You would need to turn on short_open_tag in the php.ini file. You can read more about this file here.

Charles Sprayberry
  • 7,741
  • 3
  • 41
  • 50
0

It's quite simple really. All you have to do is install the HTML in the root of your Apache PHP JavaQuery XRSS folder and then run the script that gets generated. After the script is run type in "22145" and it will run a PHP script that changes the way PHP is interpreted by the Internet and make it so you don't have to use the <?php tag on your Silverlight Python C++ encoding applet.

Justin
  • 1