Cannot open php PHTML file

Question: After installing LAMP you still have problem to open php pages .  How  to  solve  this issue.




First   check  if   this  packages  is  installed : libapache2-mod-php5 ,if not install it using this command:

sudo apt-get install libapache2-mod-php5


Now  open your  firefox  and  clear  the  cache and  history


reboot   your apache  server sudo   /etc/init.d/apache2  restart

Method  tested  and  working under  ubuntu and  debian versions

  • Froyamel

    Maybe you are trying to open a php file from your public_html user directory like i was. I solve the problem changing my /etc/apache2/mods-enabled/php5.conf file by commenting the blond lines:

    SetHandler application/x-httpd-php

    SetHandler application/x-httpd-php-source

    # To re-enable php in user directories comment the following lines
    # (from to .) Do NOT set it to On as it
    # prevents .htaccess files from disabling it.
    # php_admin_value engine On

    after that I restarted the apache and typed in the url box of the browser some like this:

    and it worked! I hope this could help. :D

  • Pingback: satimis on "Problem on installing Wordpress" | Upgrade Wordpress()