TerranRich
TerranRich

Reputation: 1298

How do you remove older multiples of PHP installed in Apache?

I am trying to run Drupal 8 on one of my servers, but during the in-browser installation of Drupal it's giving me a different PHP version (7.0.23) than when I run php -v on the command line (7.1.12).

When I do a locate bin/php I get several locations:

/usr/bin/php
/usr/bin/php-config
/usr/bin/php-config7.0
/usr/bin/php7.0
/usr/bin/php7.1
/usr/bin/phpize
/usr/bin/phpize7.0
/usr/sbin/phpdismod
/usr/sbin/phpenmod
/usr/sbin/phpquery

When I check the version of each one, I see that the php7.0 package is set to 7.0.23 and php7.1 is set to 7.1.12. Bingo.

Now, how can I safely remove the php7.0 installation while keeping php7.1 and not ruining Apache? Thanks.

Upvotes: 3

Views: 702

Answers (1)

TerranRich
TerranRich

Reputation: 1298

Here's how I did it, after the very helpful comments from apokryfos and Jeffwa above:

sudo a2dismod php7.0
sudo a2enmod php7.1
service apache2 restart

And that seemed to work! Thanks all.

Upvotes: 1

Related Questions