Apache - Marcus Povey

3 min read


So, ownCloud has been a great tool to share files across my different devices for quite some time. I've also learned How to Make a Minecraft Server, which has been pretty fun. It's an PHP application so it's easy to set up.



To run the latest Known code, I updated my server to PHP 7.3. PHP 7.3 is the most recent stable code and should be used by everyone.



This was a problem as ownCloud could only run on PHP versions up to and including 7.2. The next version of ownCloud will likely to support PHP 7.3, however release dates are slow, and I really needed to get my syncing up and running again.



The obvious solution would be to use PHP 7.2 for the ownCloud server first, and then PHP 7.3 for everything else.



Installing PHP-FPM



If you are still using the old mod_php apache module then you'll require installing PHP-FPM.



This is the latest way to run PHP and I was planning on doing it regardless. It's quicker, provides more performance options and, most importantly, for my purposes, decouples Apache and PHP to allow you to run multiple versions.



On Debian based servers (mine is Debian, with an external PHP 7.3 apt repository set up) It can be extremely simple:



You'll also need to install all the PHP modules you need (pdo and gd, for example), but I'll leave that an exercise for the reader.



Then, you'll need to change your configuration:



Two things to note here. First replace the a2dismod file with the current version of PHP. Secondly, you'll notice 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.



The phpinfo search() should show you something like this:



Note the PHP version and the Server API.



If you look at your server's processes, you'll notice both PHP 7.3 and PHP 7.2 FPM servers running:



Configuring ownCloud's VirtualHost to use PHP 7.2



Now you will have to modify your personalCloud VirtualHost to enable the PHP CGI server at a speed of 7.2.



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.



Put the following in your ownCloud virtual host definition:



Now, when you run a PHPinfo() on your ownCloud domain, you'll be able to see it running PHP 7.2!



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



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



Anyway, I thought this was pretty cool. I hope you'll find it useful too!

HUNTER
In case you have found a mistake in the text, please send a message to the author by selecting the mistake and pressing Ctrl-Enter.
Comments (0)

    No comments yet

You must be logged in to comment.

Sign In / Sign Up