skip to Main Content

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


  1. Chosen as BEST ANSWER

    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!


  2. First, try to update your ubuntu version. Ubuntu 18.04 is a stable version. After that execute these commands.

    1. apt install software-properties-common
    2. add-apt-repository ppa:ondrej/php
    3. apt update && apt-get install php7.4-fpm

      After that you have to add these lines into nginx config file.
    location ~ .php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
      }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search