I have installed PHP, Apache in my Linux server. http://localhost/index.htm displaying correctly. To test the PHP I have created test PHP file phpinfo.php. Here is the code in that file
<?php phpinfo(); ?>
But when try to http://localhost/phpinfo.php, browser displays script in the file. Apache did not execute the script in the file. What would be reason for this?
Well this means that php is not enabled for your webserver. Have you restarted apache after installing php as well as have you tried
a2enmod phpora2enmod php5