If you explicitly set those values in your php.ini file and they are not the same when you run your PHP script, then something has overridden them. You know your php.ini settings are correct because the CLI version of PHP info shows the new settings.
I have also run php -i | grep ".ini" to check which files are loaded, and there are no unnecessary loaded configs. I even went through each loaded file individually to check they didn't have the settings inside.
This is great, but it's telling you what .ini files have been loaded from the PHP CLI---not your application.
You need to check the Additional .ini files parsed section of your phpinfo()
output to see exactly what files are being loaded from your web server. One of those files is overriding your settings.
Finally, if none of those files turn out to be the culprit, you should do a global find on ini_set()
in your project to make sure some rogue script isn't setting those values for you (trying to be helpful).
Keep digging, you'll find the culprit in one of those two places.