How do I configure PHP + Apache on Amazon EC2?
First try using full tags, so your script would be.
<?php phpinfo(); ?>
instead of <? ?>
If no luck, try:
sudo yum remove phpsudo yum install php
then service httpd restart
Alternatively try using one of the pre-built AMI's. Community AMI's have several LAMP configurations.
Just for those who get here from Google, try this:
sudo yum install -y phpsudo yum -y install httpd
If you need development versions:
sudo yum install -y php-develsudo yum -y install httpd
If you need Apache 2.4 and PHP 5.4:
sudo yum install -y php54sudo yum -y install httpd24
From:Install Apache, PHP, and MySQL on Amazon LinuxInstall Apache 2.4, PHP 5.4, and MySQL on Amazon Linux
Just tar your info.php;
Upload it to another public directory;
Get the file to ec2 with wget;
Untar the file.
That's it ;)