Recently I had trouble updating my WordPress site because it was configured to use an older version of PHP even though I had upgraded the PHP version on the server as explained everyone online.
I contacted tech support and they were very helpful. Not only did they fix the problem, but provided an explanation so I’m passing on the information rephrasing it so as to provide the tip to everyone else since I couldn’t find the answer on the internet anywhere else:
In the .htaccess file in the wordpress’ website’s folder there is a line that sets the php version manually. It looks like…
SetEnv PHP_VERSION 5
By deleting the line or commenting it out using a hash symbol like…
#SetEnv PHP_VERSION 5
you prevent WordPress from overriding the server’s php version settings and you can then upgrade WordPress. I later changed the commented-out line to reflect the version of PHP I was using to avoid confusion.