Firstly, a note: PHP themselves actually suggests not using short-tags like this. PHP's own syntax manual even mentions this, because short-tags support is not a default option - it either has to be compiled into PHP or enabled in the php.ini
file:
PHP also allows for short open tag <?
(which is discouraged since it is only available if enabled using the short_open_tag php.ini configuration file directive, or if PHP was configured with the --enable-short-tags option).
Because short-tags are not a default-supported thing, this is why <? ... ?>
is rendered as-is and not processed as PHP.
If you really want to make this work, then you have to set in your php.ini
files for the PHP configurations this:
short_open_tag=On
Depending on what web server or PHP proxy handling system you use, you may have differing php.ini
locations. (This is, however, discussed in other questions and answers, such as here.)
However, as PHP themselves don't recommend using short tags, you should really consider not using short-tags at all in your PHP code.