5

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?

erol_smsr
  • 1,454
  • 4
  • 24
  • 49

1 Answers1

5

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
JWang
  • 181
  • 6
  • I ran both commands, but it didn't change anything. I ran `sudo update-alternatives --set php /usr/bin/php7.0` (/php7 doesn't exist, 7.0 does). The command didn't return any kind of message and I restarted Apache with `apache2` restart. When I look at the phpinfo page, it still says PHP version 5.6.14-1. – erol_smsr Feb 23 '17 at 15:23
  • 1
    I remember something,maybe you can try "a2dismod php5.6" ,then "a2enmod php7.0" – JWang Feb 26 '17 at 10:57
  • Thanks for the help! Your solution did eventually work, however, I found Puphet which is the same thing as Scotch Box, but with PHP7 and other additional tools built-in (https://puphpet.com/) – erol_smsr Feb 27 '17 at 12:02
  • 1
    Just update the box to the latest version (3.0 supports this now) – envysea Jun 04 '17 at 22:21