当前位置: 动力学知识库 > 问答 > 编程问答 >

Make PHP 7 run on Apache instead of 5.6 with Scotch Box / Vagrant

问题描述:

I've installed Scotch Box and updated the PHP version to PHP7. However, it seems like I've updated the PHP CLI, not the PHP version that Apache uses. I see other answers on SO saying that in the Apache httpd.conf there's a line that says loadModule php5 or something. I've checked it and in my httpd.conf it doesn't say anything about loadModule at all.

I did see that PHP7 is installed in a path with /cli/ in it, while PHP 5.6 is installed in a path with /apache2/ or apache in it.

In short, how do I get PHP7 to work on Apache installed on Scotch Box?

网友答案:

I use vagrant,and i use ubuntu as my OS,so i just use apt-get to install the php7...in my experience,you can switch the php version using:

sudo update-alternatives --query php
sudo update-alternatives --set php /usr/bin/php7

if it didn't work ,you can try this:

sudo a2dismod php5.6
sudo a2enmod php7.0
分享给朋友:
您可能感兴趣的文章:
随机阅读: