Is there a php (or composer) command to change upload_max_filesize && post_max_size from terminal?
The reason; having a more a version-agnostic and more
  backward-compatible directive in my server-environment-establishment
  script, to change the values of these two variables.


If you're trying to configure a server, you should use a configuration management system (Ansible, Puppet, Chef, Salt) or bake images for immutable infrastructure; trying to hack in pieces of configuration via PHP or bash or whatever will just make you unhappy.