After installing nGinX on Ubuntu 12.04, installing PHP and setting up my vhosts to run PHP I created a file called test.php, but only the php info is displaying not the echoed text.
This is the content of my test file
<?php phpinfo(); ?>
<?
echo 'hello php test';
?>
I hadn’t noticed that I switched to short tags while writing this script. After changing my short tags
<?to long tags<?phpthe php echoed the string correctly.I am migrating a bunch of php files to the new server with short tags, so I needed to enable short tags in my php.ini file.
To do that I updated the following line within the php.ini file
short_open_tag = On
Next I had to restart nginx
sudo service nginx restart