Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Take A QuizChallenge yourself and boost your learning! Start the quiz now to earn credits.
Take A QuizUnlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
Take A QuizKindly log in to use this feature. We’ll take you to the login page automatically.
LoginGeneral Tech Bugs & Fixes 3 years ago
User submissions are the sole responsibility of contributors, with TuteeHUB disclaiming liability for accuracy, copyrights, or consequences of use; content is for informational purposes only and not professional advice.
You should be able to fix your problem by running the following commands
sudo apt-get install libapache2-mod-php7.0
sudo a2dismod php*
sudo a2enmod php7.0
sudo apache2ctl restart
After adding Ondrej's repository, installing PHP 7 may not be enough as you will also need to install and enable Apache's PHP module for the version of PHP you need.
This may be reason why PHP works in CLI mode, but not with Apache.
Note: I haven't tested sudo a2dismod php* on Ubuntu 14.04, but in case it doesn't work, just type sudo a2dismod php and tap the tab button so php auto-completes to whichever PHP version is enabled.
No matter what stage you're at in your education or career, TuteeHUB will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
Kindly log in to use this feature. We’ll take you to the login page automatically.
LoginReady to take your education and career to the next level? Register today and join our growing community of learners and professionals.
Your experience on this site will be improved by allowing cookies. Read Cookie Policy
Your experience on this site will be improved by allowing cookies. Read Cookie Policy
manpreet
Best Answer
3 years ago
I'm running Ubuntu 14.04 with Apache2 and PHP7.
For some reason,probably after I updated the PHP version,it is no longer executing. This is the output of
The root folder is
/var/www/htmlThe
PHP.confis configured correctly,I believe.When I add
And try to load a PHP script then it gets downloaded and not loaded in the browser.
Any ideas?
I appreciate it!