PHP Pages Displaying Code And Not Rendering Code

For some reason my server started displaying code instead of actually processing or rendering the code.

After playing around with the server I noticed the php5 module was missing from Apache.

If your code is displaying and not rendering you may have the same issue.

To install and enable it run the following command.

sudo apt-get install libapache2-mod-php5
sudo a2enmod php5

Then restart your apache. The restart command is different depending on the distro you’re using.
A simple Google search will help you.

 

This is the forum post that helped me fix my issue.

http://ubuntuforums.org/showthread.php?t=1546116&p=9681081#post9681081

Share this Story
  • Laravel

    Laravel Upgrade Considerations and Tips

    Laravel claims estimated upgrade times upgrading version to version, but this estimation may not be true for you. Upgrades take time ...
  • PHP

    Using array_reduce to Transform Data

    First, why we might transform data? If we have raw data from a database and need to send data to an ...
  • Programming

    Selecting Your Next App Dependency

    We often turn to open source or proprietary packages for adding functionality to our apps. Here are some key points and questions to ask when selecting your next dependency.
  • Tips

    Trade-offs

    As developers we work with non-technical people and we can do a better job connecting with them. Non-technical people don’t care ...
  • Life Pro Tip Tips

    Mental Snapshots

    Think back to a time where you accomplished something you had no idea how to do or when you accomplished something ...
  • Laravel Programming

    The Importance of Eager Loading Laravel Relationships

    Problem Page took over 30 seconds to load locally on a local Vagrant virtual machine. After investigating the results were astonishing, ...
Load More Related Articles
  • Laravel

    Laravel Upgrade Considerations and Tips

    Laravel claims estimated upgrade times upgrading version to version, but this estimation may not be true for you. Upgrades take time ...
  • PHP

    Using array_reduce to Transform Data

    First, why we might transform data? If we have raw data from a database and need to send data to an ...
  • Programming

    Selecting Your Next App Dependency

    We often turn to open source or proprietary packages for adding functionality to our apps. Here are some key points and questions to ask when selecting your next dependency.
  • Tips

    Trade-offs

    As developers we work with non-technical people and we can do a better job connecting with them. Non-technical people don’t care ...
  • Life Pro Tip Tips

    Mental Snapshots

    Think back to a time where you accomplished something you had no idea how to do or when you accomplished something ...
  • Laravel Programming

    The Importance of Eager Loading Laravel Relationships

    Problem Page took over 30 seconds to load locally on a local Vagrant virtual machine. After investigating the results were astonishing, ...
Load More By Nick Escobedo
Load More In How-To's

Check Also

Laravel Upgrade Considerations and Tips

Laravel claims estimated upgrade times upgrading version to ...