If you have access to your own dedicated server or virtual machine:
Open up the terminal, type sudo nano /usr/local/lib/php.ini
,
make the required changes, hit Ctrl + O to save, and then Ctrl + X to exit.
If you want to copy to somewhere else, use cp /usr/local/lib/php.ini /path/to/new/location
If you are using a shared hosting provider
You can not modify the php.ini file or use another version. You will need to override the settings in the .htaccess
file or a PHP runtime. Please note that your shared host may have these settings disabled, so you can't hog the shared server's RAM.
File .htaccess example
php_value memory_limit 16M
Runtime example (at the very top of the PHP script)
ini_set('memory_limit', '16M');