Monday, September 26, 2016

Why My PHP Code Showing in Browser?

This is my small notes for self-reminder. I've been experiencing this problem after setup new environment for web development. Although I'll always found the solution, I'm blaming myself once this same problem raise again: why I don't remember this super basic principle? So, I'll leave this tips here, hopefully will be useful to others.

What's actually happen here? So, basically, after installing apache and php, if you open your PHP file, you'll hope that browser will execute it and display rendered HTML. Then, you surprised that browser display PHP code instead. So, if you're facing this problem right now, try to run this command in terminal/console: (in this case, I'm using Debian. It's should be compatible with Ubuntu, for example).
sudo apt-get install php5 libapache2-mod-php5
Once finished, restart apache. Your problem should be fixed by now (hopefully).

Related Articles


  1. Thanks a lot very much for the high quality and results-oriented help. I won’t think twice to endorse your blog post to anybody who wants and needs support about this area.

  2. Women are more than twice as likely to have a tattoo removed as men.
    tattoo supply

  3. Thanks for the tip Anggy!! Much appreciated.

    PHP trainer @ Kamal Technologies - Best PHP Training Institute - Chennai

  4. Pretty blog, so many ideas in a single site, thanks for the informative article, keep updating more article.
    Webdesining course in chennai

  5. Technology is updated day to day
    Thanks for sharing the info, Salesforce is the best platform for all organizations to perform the multiple tasks at a time
    Best Salesforce online Training
    Salesforce certification Training program
    Salesforce Online Training in Bangalore

  6. Do not wait for a miracle, go to the online casino. great casino gambling Excitement is interesting.

  7. I like your post very much. It is very much useful for my research. I hope you to share more info about this. Keep posting!! Best PHP Training Institute

  8. Your blog looks great, I am happy with your blog.
    Php Code will not make a website complete, untill unless the Digital Marketing & SEO related on page activities is done.
    Comment by,
    Digital Marketing Course Training Institute in Chennai"

    SEO Course Training Institute in Chennai"

  9. This comment has been removed by the author.