-3

I have an ubuntu server installed with apache2 service. but when I run the index.php file its displays as it is. it means .php files are not executing

  • 1
    Have you looked at this 1. https://serverfault.com/questions/1019602/php-files-displayed-as-text 2. https://stackoverflow.com/questions/19512142/php-code-showing-in-browser 3. https://stackoverflow.com/questions/36777886/php-code-is-rendered-as-text – Shailesh Sutar Mar 27 '21 at 07:43
  • Do you have php installed and Apache set to use it? – Ackack Mar 27 '21 at 16:37
  • 4
    Does this answer your question? [PHP files displayed as text](https://serverfault.com/questions/1019602/php-files-displayed-as-text) – Dennis Nolte Mar 30 '21 at 07:56

2 Answers2

0

Be sure that you have installed php and enabled the apache component. Something like a2enmod php7.0 will enable the php processor module for apache if it is installed.

If that does not work, try following this tutorial from DigitalOcean, it is quite good explained...

Also check out the recomendations from the community.

-2

Manually open file in terminal and check for the code. Your file might be saved in rtf or html file, irrespective of ".php" file format.