Apache - Marcus Povey

Apache - Marcus Povey


So I've been using myCloud for a while as an easy way to share certain files across my devices. I've even learnt on How to Make a Minecraft Server which has been a lot of fun. It's a PHP application, so it's simple to install.

So, I have updated my server to PHP 7.3, in order to run the most recent Known code, among other things. PHP 7.3 is the most stable version, and it is the one everybody should be running, in fact.

This was a major issue since ownCloud could only run on PHP versions up to and including 7.2. Although PHP 7.3 will be supported in the coming version of ownCloud the release schedules aren't as fast and I needed to get my syncing on the right track.

It is possible to use PHP 7.2 on the ownCloud server, as well as PHP 7.3 on all other apps.

Installing PHP-FPM

If you are using the old mod_php apache module then you'll have to install PHP-FPM.

I was going to do this in the past since this is the modern way of running PHP. It's faster, gives you numerous options for performance, and, most importantly for me, it removes Apache from PHP meaning you have the option of running several versions.

On Debian based servers (mine is Debian with a third party PHP 7.3 apt repository set up) It can be extremely easy:

You'll also want to install all the PHP modules you need (pdo or gd, for instance) however I'll leave that an exercise for the reader.

The next step is to change your configuration:

Two points to be noted here. First, replace the a2dismod statement with the version of PHP you currently have installed. Also, you'll notice that I didn't activate the PHP 7.2 FPM config. This is because PHP 7.3 should be the default, however PHP 7.2 can be enabled on certain virtual hosts.

Checking phpinfo() should show you something similar to this:

Note the PHP version and the Server API.

You'll see PHP 7.3 FPM servers running if you look at your server's processes.

libertycm.tv

Configuring ownCloud's VirtualHost for PHP 7.2

So, now you need to change your ownCloud VirtualHost to use the PHP 7.2 fast CGI server.

Again, this is really really easy, and is pretty much a cut and paste from the php7.2-fpm.conf file you'll find in your /etc/apache2/conf-available directory.

The following should be included in your ownCloud definition of virtual host

Now when you run phpinfo() on your ownCloud domain, you should find it running PHP 7.2!

Now I'm back to syncing my files, while running the most recent PHP version for other domains.

This is a useful feature that can be used to get more than just slow to get software updated and running. This method will allow me to run an advanced PHP version such as PHP 7.4 against my development version, Known, and keep my blog running the stable version.

I think it was cool. Hopefully you'll be able to use it too!

Report Page