I have some PHP files developed on a Linux machine, which I am now working on on a Mac (OS 10.8.2). Pages were not showing up correctly on the Mac, even when they were showing correctly on the linux box. After some investigation, I found that it was because it wasn’t recognizing syntax like this:
<?=$var ?>
Anything starting with just a <?, rather than a <?php (not just the var shortcut above, any block of code) is being interpreted as plain text, rather than PHP. On the Linux dev box and production server, the shortcut <? syntax is recognized just fine. I assume this is a configuration thing that I missed during setup, so what did I miss? Can I configure my Mac to recognize this syntax?
The mac is running PHP 5.3.15. The dev box is running an earlier 5.*. I don’t know the version on the production server.
These are called short tags.
Edit your
php.inifile and set: