Upgrading from php5.6 to php7

Orion Tiller orion at blackboxconsortium.com
Wed Dec 6 22:24:48 UTC 2017


> I need to upgrade from php 5.6 to php 7.0.
> Can someone tell me how I can do that best? Read a lot of solutionson
> the web, but all tell different from each other.
>
> Would it be better to first deinstall php 5.6 and then start all over
> with php7?
>
> Thanks, Jos
>
>
Yes doing it that way has worked for me. 

$ pkg remove php56

If you are going to need the pecl-redis extension you will need to
compile it for php7.0 from ports otherwise pkg will try to remove 7 and
reinstall 5.6
I know this works for 7.1 but I have never done this with 7.0 but it
should be the same.

    //pecl-redis workaround for PHP 7.0
    $ echo DEFAULT_VERSIONS+=php=7.0 >> /etc/make.conf
    $ cd /usr/ports/databases/pecl-redis/
    $ make install clean
    $ pkg lock pecl-redis

then install 7.0 and any other extensions you will need

    $ pkg install php70



More information about the freebsd-questions mailing list