Arunesh Posted July 16, 2019 Share Posted July 16, 2019 Hello all back some days I was facing issue in executing PHP code in AWS Cloud9 now the respective code is producing output as for the arguments passed as guided here https://docs.aws.amazon.com/…/l…/user-guide/sample-php.html… using filename.php 10 25 but getting some error kindly guide code <?php print("Hello, World!"); print("\nThe sum of 2 and 3 is 5."); $sum = (int)$argv[1] + (int)$argv[2]; print("\nThe sum of $argv[1] and $argv[2] is $sum."); ?> output Running PHP script /home/ubuntu/dev-ide/test1.php (standard_in) 1: syntax error bash: line 9: [: -eq: unary operator expected Hello, World! The sum of 2 and 3 is 5. The sum of 10 and 25 is 35. Quote Link to comment https://forums.phpfreaks.com/topic/308974-kindly-guide-getting-certain-bash-error-on-running-php-script-in-aws-cloud9-but-produces-given-output/ Share on other sites More sharing options...
taquitosensei Posted July 16, 2019 Share Posted July 16, 2019 How are you running the php script? You have to do "php -f /home/ubuntu/dev-ide/test1.php" Quote Link to comment https://forums.phpfreaks.com/topic/308974-kindly-guide-getting-certain-bash-error-on-running-php-script-in-aws-cloud9-but-produces-given-output/#findComment-1568430 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.