Update PHP version on Amazon EC2

It was time to update the PHP version on my WordPress server. WordPress gave me warnings; the site health plugin gave me a warning. Plugins gave me warnings. PHP, IT news sites, the internet, warnings everywhere.

I knew that my PHP version was very old. But still supported. At least until beginning of 2019. When I configured the server for the first time several years ago, the installed PHP version was already not the latest. It was what yum install php gave me. Updating software is crucial, so I decided to finally touch my running system.

WordPress provides a site explaining how to update your PHP version. The update process in the documentation goes like: write an email to your hoster. Or: Not working in my case. For those that want to know how to update PHP on a Amazon AMI EC2 instance, here are the stops and my lessons learned.

Preparations

First, do a backup. Update WordPress and the plugins. Check that the plugins are compatible with PHP 7.2

  • Backup: See my blog on how to create a snapshot of a EC2 instance.
  • Update WordPress and plugins: Easy: just do as always and keep it up-to-date.
  • Check plugins for compatibility: A plugin is available to check the installed plugins and files for compatibility with PHP 7.x. Install and activate it and run a test.

The PHP Compatibility plugin is started from the WP Admin site. Hint: in my case, the plugin worked fine, but also crashed the server. After running it and saving the results, uninstall it.

This gives as an output an evaluation of the plugins and their compatibility status.

Update

Next step is to update PHP. Use the package manager for this. I’ll split the installation process in two parts: PHP and the additional packages.

sudo yum update
sudo yum install php72
sudo yum install php72-opcache php72-mysqlfnd php72-gd php72-pecl-imagick php72-bcmath

Result installation PHP 7.2

Result Installation of additional PHP packages

Activate PHP

After installing PHP 7.2 it must be activated. The old PHP version is still the default one, meaning that calling php is not calling php 7.2. To change the paths, run alternative. It will show the available alternatives and asks which one you want to use. I am going to use php 7.2, so the input here was 2.

alternatives --config php

php -version

Now PHP 7.2 is installed and activated. After restarting Apache WordPress will run on a newer PHP version.

Let the world know

Personas 3.0 SP4 post-installation tasks

After installing Personas 3.0 SP4, you have to do some additional tasks in your system to really enjoy the power of Personas 3.0. These steps are outlined in the release note 2376426, as well in the note 2383296 and 2376427. Both SAP Note are going to be uploaded manually to my NetWeaver system, as I do not have a connection to SAP. You can follow the steps my other blog on how to do this.

Required post-installation corrections

First apply note SAP Note 2383295: SAP Screen Personas 3.0 SP04: Required post-installation corrections. Download the SAP Note and upload it to your system via SNOTE.

The status of the note: can be implemented. The note will implement four corrections.

Lot of changes going to happen.

After executing this, the SAP Note is implemented.

Update of client source files

Next note to apply is 2376427 – SAP Screen Personas 3.0 SP04: Update of Client Sources Files. Download the SAP Note and upload it to your system via SNOTE.

The status of the note: can be implemented. Confirm the changes the note will apply.

The note was successfully implemented.

Test

Access https://<server>:<port>/sap/bc/personas

Pressing ALT or Option (Mac), I can see now the keyboard shortcuts.

Instant script feature.

Let the world know

Install Personas 3.0 SP4

Pre-requisites

Check that Personas 3 add-on and is already installed. SP04 is a support package, therefore SPAM is used to install it. SP4 needs SPAM with patch 63 in NetWeaver 7.5. Ensure to update first your SPAM to the right version. See my other blog on how to update SPAM. Before you can update, check that there are not objects locked in a transport request.

Update

  • Transaction: SPAM
  • Client: 000
  • User: user with right permissions

Check that SPAM status is green and no queue is defined.

Upload SAR file: Support Package -> Load packages -> From Front End

Decompress.

Check the uploaded package. Select new support package under directory and then display.

The status needs to be yellow (not yet imported) and the perquisite set 01 all must be green and ok.

Select the package and click on Queue to define a new queue.

This SP04 is not protected with a password.

Select No. This brings you back to SPAM main screen. The status is now yellow and next action is given as import queue.

Import queue. Go to: Support Package -> Import queue.

You can now go get a coffee or follow the status messages in the status bar.

At the end of the import, a dialog is shown. It should be a nice “success!!” dialog, I got this:

What happened is that I applied a Personas 3 note that changed some standard objects. The dialog is SAP’s polite reminder to check if I want to keep these changes or discard them and let Personas 3 SP03 overwrite them. I want to not keep them and let Personas 3 use its own repository objects, so I selected continue. At the end you’ll see a short walk through what you should do (analyse the stuff, etc), although this isn’t possible in my demo system, as I do not have a SAP Note connection – something needed to run the validation.

Status is now: Confirm queue