Upgrade php version to php7 on debian 8

Hi All,

I am currently running nextcloud using php v5.6.22 on debian 8. I was wondering if it is worthwhile upgrading to php7? Has anyone done this and are there any benefits (performance etc.) to upgrade?


Yes, definitively ! :smile:

I can confirm this. I’m using Debian 8 + php7 (dotdeb-packages). They also provide redis- and apcu-caching packages for php7.

Hi @tflidd,

Did you do a clean install of NC with php7 or upgrade an existing instance of NC? I am currently running NC 9.0.52 with php5.6 and APCu


I made a new installation of my operating system (to Debian 8) and then migrated everything to the new setup. I don’t see a problem keeping your old instance except you want to start new for different reasons.

As NC does not have any php-version related versions, just remove old php, insgall new, restart webserver, done.

Thanks @z000ao8q. I’ll test it in the lab to see if there are any issues :smile:

Does someone has a “How To” for changing PHP5.6 to PHP7. I ran a owncloud Instance and just Upgraded to Nextcloud10 and want to “upgrade” or change my PHP but i’m not sure how and which commands i have to use. I have Debian 8 aswell. Any advices would be awesome.

https://www.dotdeb.org/ provides php7.0 packages that you can easily install via apt-get (you must add their sources first). It shouldn’t be difficult; you can even have both installed (shouldn’t use both at the same time). Don’t forget all the modules needed for nextcloud, I use these:

libapache2-mod-php7.0                           install
php7.0-apcu                                     install
php7.0-apcu-bc                                  install
php7.0-cli                                      install
php7.0-common                                   install
php7.0-curl                                     install
php7.0-gd                                       install
php7.0-igbinary                                 install
php7.0-imagick                                  install
php7.0-imap                                     install
php7.0-intl                                     install
php7.0-json                                     install
php7.0-mbstring                                 install
php7.0-mcrypt                                   install
php7.0-mysql                                    install
php7.0-opcache                                  install
php7.0-phpdbg                                   install
php7.0-readline                                 install
php7.0-redis                                    install
php7.0-sqlite3                                  install
php7.0-xml                                      install

Use a2dismod php5 and a2enmod php7.0 to disable php5 and enable php7. If you haven’t fully configured php7 yet, you can easily disable php7.0 and enable php5 again. Don’t forget to restart apache after enabling/disabling modules.

1 Like

THANK YOU. Just did following Steps:

  1. add these two lines to your /etc/apt/sources.list file
    deb ...packages.dotdeb.org jessie all
    deb-src http://packages.dotdeb.org jessie all
  2. Key installation
    wget http://www.dotdeb.org/dotdeb.gpg
    cat dotdeb.gpg | apt-key add -
  3. Update
    apt-get update
  4. Install PHP7
    apt-get install libapache2-mod-php7.0 php7.0-apcu php7.0-apcu-bc php7.0-cli php7.0-common php7.0-curl php7.0-gd php7.0-igbinary php7.0-imagick php7.0-imap php7.0-intl php7.0-json php7.0-mbstring php7.0-mcrypt php7.0-mysql php7.0-opcache php7.0-phpdbg php7.0-readline php7.0-redis php7.0-sqlite3 php7.0-xml php7.0-zip
  5. disable php5 enable php7
    a2dismod php5
    a2enmod php7.0
    service apache2 restart

Awesome. Thank you, WORKING.


HI. Justt say I needed to change the sources to:

deb http://packages.dotdeb.org jessie all
deb-src http://packages.dotdeb.org jessie all