LEMP Stack on Ubuntu Server 13.04 not parsing PHP Switch Statement Properly
- by schester
On my Ubuntu 12.04 Server LTS on nginx 1.1.19, the following PHP code works properly:
switch($_SESSION['user']['permissions']) {
case 9:
echo "Super Admin Privileges";
break;
case 0:
echo "Operator Privileges";
break;
case 1:
echo "Line Leader Privileges";
break;
case 2:
echo "Supervisor Privileges";
break;
case 3:
echo "Engineer Privileges";
break;
case 4:
echo "Manager Privileges";
break;
case 5:
echo "Administrator Privileges";
break;
default:
echo "Operator Privileges";
}
However, I have a backup server running Ubuntu Server 13.04 on nginx 1.4.1 which has the exact same copy of the script (synced) but instead of breaking on the break; command, it echos the whole php script.
The output on the 12.04 Box is similar to this:
You are logged in with Super Admin Privileges
But on the 13.04 Box, the output is like this:
You are logged in logged in with Super Admin Privileges"; break; case 0: echo "Operator Privileges"; break; case 1: echo "Line Leader Privileges"; break; case 2: echo "Supervisor Privileges"; break; case 3: echo "Engineer Privileges"; break; case 4: echo "Manager Privileges"; break; case 5: echo "Administrator Privileges"; break; default: echo "Operator Privileges"; } ?>
I have also tried changing the script from switch statement to if statements but same results. Any idea what is wrong?