Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am trying to configure LAMP in my Ubuntu 15.10 Desktop with PHP 7.0, Apache2, and MySQL.

Everything seems to be working but when i try to execute any php file by putting it on path (/var/www/html), the file gets downloaded.

Below are the commands which are already looked up and tried, but I couldn't get it to work.

sudo apt-get install php7.0
sudo apt-get install libapache2-mod-php7.0 
sudo a2enmod php7.0
sudo service apache2 restart

Am I missing anything? Please let me know any suggestions or advice will be very appreciated.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
237 views
Welcome To Ask or Share your Answers For Others

1 Answer

I don't know if this is distro specific, but (assuming you are using Apache 2.4) there are some additional steps you might look into.

First, in your httpd.conf file, look for: "LoadModule mpm_event_module modules/mod_mpm_event.so" and COMMENT that out.

The next line "#LoadModule mpm_prefork_module modules/mod_mpm_prefork.so" should be UNCOMMENTED.

Then, add this include at the end of the file: "Include conf/extra/php7_module.conf"

Restart Apache and you should be up and running.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...