php -d memory_limit=2048M composer require magento/product-community-edition 2.2.3 --no-update
php -d memory_limit=2048M composer update
If this fails go for
If you haven't linked composer to your users bash, then replace composer with
It will return the path to the composer executable in your server. For example:
/usr/local/bin/composer and the command will look like:
php -d memory_limit=2048M /usr/local/bin/composer require magento/product-community-edition 2.2.3 --no-update composer update
Same goes for php. If you got multiple php versions you should use the php7 version. Run
$which php and it will return the paths that php in installed in. The parenthesis just execute the return as well so you can use them in commands like the one i gave you.
Please do this with care. Open a second terminal and monitor your processes, try
htop, for possible memory leaks(so you can kill the processes with kill $pid of the memory eating one).
As for the hard limit you face.
What kind of webserver are you using and what php version/package for php code?
What kind of values exist on your php.ini and if you are using php-fpm on your fpm-pool for this user?
Magento 2 example configurations for both apache and nginx set the value for memory limit via .htaccess, .user.ini or FastCGI memory_limit to 768 and might be overriding your values.
If you are on a shared hosting with many restriction then try this:
find - /name php.ini
Find the one that fits your php-version.
Edit this file and set
memory_limit=-1. DO NOT FORGET TO REVERT THE CHANGE AFTER YOU ARE DONE.
If you are using Apache then:
create a php.ini file in your Magento installation root folder(copy
php's default we found above. cp /path/to/php7/etc/php.ini
memory_limit value as said above.
create .htaccess file on your Magento installation root folder and
add this line
SetEnv PHPRC /path/to/magento/root/php.ini.