I was trying to run a simple PHP script on Amazon EC2.
As i got blank screen on the browser, started putting some garbage syntax or echo in between steps. Then i figured out that script was failing without any error.
How to disable silent failure?
<?php
putenv('HOME=/root');
echo 'after env'; //displayed on browser
require_once('/home/ec2-user/AWSSDKforPHP/sdk.class.php');
//i believe this require step was failed
echo 'after require'; // not displayed on browser
$ec2 = new AmazonEC2();
$response = $ec2->describe_availability_zones();
print_r($response);
echo 'hello';
?>
It can depend on your
php.inisettings, error display or error reporting might be off.Add this to the top of your script: