So you need to upgrade PHP, you’re fed up seeing the warnings in everything from WordPress to Joomla and everything in between, then we need to upgrade PHP to version 7. This upgrades to 7.3 as it is the most stable at this point.
So first, lets install the new version of PHP and the respective modules we will want to be using with it.
> apt-get install php7.3 > apt-get install php7.3-bcmath php7.3-bz2 php7.3-dba php7.3-dom php7.3-imap php7.3-gd php7.3-mbstring php7.3-zip php7.3-soap php7.3-pspell php7.3-mysql php7.3-json
The order is important now, we need to disable php5 and enable php7, you can’t do it the other way around, the server will think you’re stupid if you do. You can’t enable something that conflicts unless the conflict is no longer there, see, pretty simple stuff really. If at this point you’re asking your server to make decisions for you, then shame on you …
> a2dismod php5
> a2enmod php7.3
Now we just need to restart apache and wham, bam, thank you mr server man … you’re now running php7.
> systemctl restart apache2
Note: These are just the default modules I use on my base web containers, you will need to ensure you replace all of your php5 modules with the 7 equivalent, the only exception being mcrypt as that is no longer supported and it can be assumed that because we are upgrading to 7+ that we no longer require it and additional software will use openssl for encryption.
Note 2: Naughty me assuming you’re using Apache … tsk tsk … I will chastise myself appropriately.
Leave a Reply