ownCloud and PHP7 update on Debian Jessie

Posted on 10 December 2015
2 minute read

ownCloud and PHP7 update coolness

I wanted to upgrade my Debian box so I could run ownCloud and PHP7 to check out the speed increases, and well, because it’s cool.

Determine previous PHP installed modules

I generated a list of previously installed PHP5.6 modules to make easy reference to what to install under PHP7:

# dpkg -l | grep -i php

Remove PHP5.x

You should remove your PHP5.x install before upgrading to PHP7. From the list generated from the dpkg output, remove the modules, eg:

# apt-get purge php php5-dev php5-curl

Install PHP7 from dotdeb repo

If you’re not already using the dotdeb repo, add this to your /etc/apt/sources.list file:

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

Download and install the dotdeb GnuPG key:

# wget https://www.dotdeb.org/dotdeb.gpg
# apt-key add dotdeb.gpg

Now run apt-get update and you should be able to install dotdeb packages.

# apt-get update
# apt-get install php7.0 php7.0-curl php7.0-dev

Install other modules in the same way that suit your particular requirements.

I had one issue with the mcrypt extension being loaded twice, so I simply removed the symlink:

# cd /etc/php/7.0/apache2/conf.d
# unlink 20-mcrypt
# /etc/init.d/apache2 restart

Restart Apache and we should be good to go! :)

External storage via SMB shares

I have a few SMB shares linked to my ownCloud instance. I had already installed the libsmbclient libraries, but to do this, run:

apt-get install libsmbclient-dev

I also needed to install the libsmbclient-php PHP wrapper for libsmbclient. This is now simply done via PECL (thanks Eduardo!):

# pecl install smbclient

This process is nice and simple too, either download the master archive from the GitHub repo, or clone it via git (this is my preferred method personally). To use git to clone it, first install git: # apt-get install git

Clone the repo: # cd /tmp git clone git://github.com/eduardok/libsmbclient-php.git

PHPize it (this requires that you already installed the php7.0-dev package as mentioned previously): # cd libsmbclient-php # phpize

Next, configure and build it: # ./configure # make

Finally install the module: # make install

This should then add the smbclient.so module into your PHP extensions directory.

Finally add the extension to your PHP config if not already done:

/etc/php/mods-available/smbclient.ini

This file should include the reference to the module:

extension=smbclient.so

SymLink this file within the Apache configuration:

# cd/etc/php/7.0/apache2/conf.d
# ln -s /etc/php/mods-available/smbclient.ini 20-smbclient.ini

Now restart Apache:

# /etc/init.d/apache2 restart

Load your ownCloud page in your favourite browser and revel in your achievements! phpinfo()