The <?
version of the open tag is called a "short tag." While the php community prefers the use of the full <?php
version of this tag, it is still acceptable to use short tags. Ideally, we would all use <?php
all the time, but we often deal with legacy code, and changing all occurrences of <?
to <?php
can be tedious and time consuming. If you find yourself in a situation where you need to allow the php interpreter to recognize the short tag, you may enable it in the php.ini file using the "short_open_tag=1" directive.
For new code you are developing, I would recommend using the long version of the tag <?php
, as you know that will be compatible regardless of the ini setting used in the servers php.ini config. For more information on this, see: Are Php Short Tags Acceptable To Use here on StackOverflow.
To figure out why your application is not running, check the webserver error logs, as well as the php error logs, and consider turning up php's error reporting level. This can also be done in the php.ini file using the error_reporting directive. This will allow you to determine what is causing the application to not run, and then you will be more informed for further questions.