Created
August 13, 2014 15:03
-
-
Save marcanuy/68ef798f7ec6794d7483 to your computer and use it in GitHub Desktop.
Enable swap file in Linux. Also solves Composer error when low memory available: "PHP Fatal error: Uncaught exception 'ErrorException' with message 'proc_open(): fork failed - Cannot allocate memory' in phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:981"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024 | |
/sbin/mkswap /var/swap.1 | |
/sbin/swapon /var/swap.1 | |
#To enable it at the boot time, add the following entry into /etc/fstab: | |
/swapfile swap swap defaults 0 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment