You have two php.ini files in your system:
- /etc/php/7.2/cli/php.ini (for php CLI)
- /etc/php/7.2/apache2/php.ini (used by the webserver)
When you do a GET /phpinfo.php you’re calling the webserver, when you run php72 -i | grep memory_limit the other config file is used.
I believe that occ commands use the CLI ini file.