So, when you run php on the commandline its only going to report back information about the
cli version of PHP. The version that is used by the website is a different file and ini.
Let’s back up a moment… did you create a 1-Click Wordpress droplet via the DigitalOcean marketplace? Or did you create a LEMP droplet and then manually install Wordpress on there? I ask because the 1-click uses Apache, not Nginx so some instructions will be different.
If you did the 1-click or are not sure, please see if you have this file:
If you do have this file, make your changes and then restart apache2:
sudo service apache2 restart
If you do not have this file, try the following command - it will list all the directories and then you can copy / paste it here so we can see what is available:
Run this command:
ls -lah /etc/php/7.2
You should see something like this:
# ls -lah /etc/php/7.2/
drwxr-xr-x 5 root root 4.0K Aug 16 13:50 .
drwxr-xr-x 3 root root 4.0K Aug 16 13:50 ..
drwxr-xr-x 3 root root 4.0K Aug 16 13:51 apache2
drwxr-xr-x 3 root root 4.0K Aug 16 13:51 cli
drwxr-xr-x 2 root root 4.0K Aug 16 13:51 mods-available
If you are not using apache2, please share the results of the
ls command so we can see what other php.ini files might be in use.
Thanks and good luck!