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

36 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
  6. Do not wait for a miracle, go to the online casino. great casino gambling Excitement is interesting.

    ReplyDelete
  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

    ReplyDelete
  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"

    ReplyDelete
  9. This comment has been removed by the author.

    ReplyDelete
  10. A very nice guide. I will definitely follow these tips. Thank you for sharing such detailed article. I am learning a lot from you.
    Salesforce certification training

    ReplyDelete
  11. Nice post I have been searching for a useful post like this on salesforce course details, it is highly helpful for me and I have a great experience with this   
    Salesforce Training melbourne

    ReplyDelete
  12. Nice information, valuable and excellent in Job, as share good stuff with good ideas and concepts, lots of great information and inspiration, both of which I need, thanks to offer such a helpful information here.
    mobile phone repair in Canton
    iphone repair in Canton
    cell phone repair in Canton
    tablet repair in Canton
    ipad repair in Canton
    phone repair in Canton
    mobile phone repair canton
    iphone repair canton
    cell phone repair canton
    phone repair canton

    ReplyDelete
  13. I have been reading for the past two days about your blogs and topics, still on fetching! Wondering about your words on each line was massively effective good wrj
    Ai & Artificial Intelligence Course in Chennai
    PHP Training in Chennai
    Ethical Hacking Course in Chennai Blue Prism Training in Chennai
    UiPath Training in Chennai

    ReplyDelete
  14. Great post! I am actually getting ready to across this information, It's very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.


    Big Data Hadoop Training In Chennai | Big Data Hadoop Training In anna nagar | Big Data Hadoop Training In omr | Big Data Hadoop Training In porur | Big Data Hadoop Training In tambaram | Big Data Hadoop Training In velachery

    ReplyDelete
  15. Thanks for the informative article. This is one of the best resources I have found in quite some time. Nicely written and great info. I really cannot thank you enough for sharing
    java training in chennai

    java training in tambaram

    aws training in chennai

    aws training in tambaram

    python training in chennai

    python training in tambaram

    selenium training in chennai

    selenium training in tambaram

    ReplyDelete
  16. PSD to HTML Cloud is a premium wordpress agency providing premium services located in US.

    ReplyDelete