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

7 comments:

  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.
    hadoop-training-institute-in-chennai

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

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

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

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

    ReplyDelete
  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

    ReplyDelete