After updating the PHP version on my digital ocean droplet running on Ubuntu 16.04, the PHP version my web server uses is still stuck on 5.6.
I have run commands to set alternatives and tried a couple of other solutions I found on the web to no avail.
The PHP version on the CLI is updated to 7.4, but that of the webserver won’t bulge and I can’t tell why.
2
Answers
Turns out I was modifying the general conf file available at: /etc/nginx/sites-available/default to use PHP7.4, rather than the specific one for the website I was working on.
I did an ls command on the /etc/nginx/sites-available/ directory that showed I had different files for all the websites there and that was it!
I just had to modify the appropriate one. This took me weeks to do. Damn!
First, try to update your ubuntu version. Ubuntu 18.04 is a stable version. After that execute these commands.
apt install software-properties-common
add-apt-repository ppa:ondrej/php
apt update && apt-get install php7.4-fpm
After that you have to add these lines into nginx config file.