composer安装fxp插件时候提示内存不足且没有交换空间的解决办法
The following exception is caused by a lack of memory and not having swap
Check https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-for details
http://www.linuxidc.com/Linux/2010-09/28915.htm ubuntu增加交换空间的步骤
提供了创建交换空间的方法
proc_open(): fork failed errors#
If composer shows proc_open() fork failed on some commands:
PHP Fatal error: Uncaught exception 'ErrorException' with message 'proc_open(): fork failed - Cannot allocate memory' in phar
This could be happening because the VPS runs out of memory and has no Swap space enabled.
free -m
total used free shared buffers cached
Mem: 2048 357 1690 0 0 237
-/+ buffers/cache: 119 1928
Swap: 0 0 0
To enable the swap you can use for example:
/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
/sbin/mkswap /var/swap.1
/sbin/swapon /var/swap.1
下面是整个过程
root@tyr:/var/www/html/laravel# ./composer.phar global require "laravel/installer=~1.1"
Changed current directory to /root/.composer
PHP Fatal error: Call to undefined method Fxp\Composer\AssetPlugin\Package\Version\VersionParser::parseLinks() in /root/.composer/vendor/fxp/composer-asset-plugin/Repository/VcsPackageFilter.php on line 272 Fatal error: Call to undefined method Fxp\Composer\AssetPlugin\Package\Version\VersionParser::parseLinks() in /root/.composer/vendor/fxp/composer-asset-plugin/Repository/VcsPackageFilter.php on line 272
root@tyr:/var/www/html/laravel# composer require "fxp/composer-asset-plugin:~1.0"
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing fxp/composer-asset-plugin (v1.0.3)
Downloading: 100%
The following exception is caused by a lack of memory and not having swap configured
Check https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for details
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:974
Stack trace:
#0 [internal function]: Composer\Util\ErrorHandler::handle(2, 'proc_open(): fo...', 'phar:///usr/loc...', 974, Array)
#1 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(974): proc_open('stty -a | grep ...', Array, NULL, NULL, NULL, Array)
#2 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(784): Symfony\Component\Console\Application->getSttyColumns()
#3 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(745): Symfony\Component\Console\Application->getTerminalDimensions()
#4 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(675): Symfony\Component\Console\Application->getTerminalWidth()
#5 phar:///usr/local/bin/com in phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php on line 974 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:974
Stack trace:
#0 [internal function]: Composer\Util\ErrorHandler::handle(2, 'proc_open(): fo...', 'phar:///usr/loc...', 974, Array)
#1 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(974): proc_open('stty -a | grep ...', Array, NULL, NULL, NULL, Array)
#2 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(784): Symfony\Component\Console\Application->getSttyColumns()
#3 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(745): Symfony\Component\Console\Application->getTerminalDimensions()
#4 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(675): Symfony\Component\Console\Application->getTerminalWidth()
#5 phar:///usr/local/bin/com in phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php on line 974
root@tyr:/var/www/html/laravel# free -m
total used free shared buffers cached
Mem: 488 414 74 24 1 71
-/+ buffers/cache: 340 147
Swap: 0 0 0
root@tyr:/var/www/html/laravel# /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 25.3413 s, 42.4 MB/s
root@tyr:/var/www/html/laravel# /sbin/mkswap /var/swap.1
Setting up swapspace version 1, size = 1048572 KiB
no label, UUID=60a9b908-925a-4161-8fca-7ae2d5a76154
root@tyr:/var/www/html/laravel# /sbin/swapon /var/swap.1
root@tyr:/var/www/html/laravel# free -m
total used free shared buffers cached
Mem: 488 474 13 24 2 127
-/+ buffers/cache: 344 143
Swap: 1023 0 1023
root@tyr:/var/www/html/laravel# composer require "fxp/composer-asset-plugin:~1.0"
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing fxp/composer-asset-plugin (v1.0.3)
Loading from cache Writing lock file
Generating autoload files
root@tyr:/var/www/html/laravel#
composer安装fxp插件时候提示内存不足且没有交换空间的解决办法的更多相关文章
- Composer安装php插件包中有哪些坑
Composer安装php插件包中有哪些坑 一.总结 一句话总结:不要盲从扩展官方的composer安装命令,有时候也会出错 我们经常要往现有的项目中添加扩展包,有时候因为文档的错误引导,如下图来自 ...
- Linux安装php-mysql提示需要:libmysqlclient.so.18()(64bit)的解决办法
Linux安装php-mysql提示需要:libmysqlclient.so.18()(64bit)的解决办法 在LNMP编译环境下安装zabbix会出现 执行:yum -y install net- ...
- Oracle安装过程物理内存检查及临时temp空间不足解决办法
物理内存 – 此先决条件将测试系统物理内存总量是否至少为 922MB (944128.0KB). 预期值 : N/A 实际值 : N/A 错误列表: – 可用物理内存 PRVF-7531 : 无法在节 ...
- sublime text3安装后html:5+Tab不能快速生成html头部信息的解决办法
sublime text3安装后html:5+Tab不能快速生成html头部信息的解决办法: 需要下载Emmet插件,按网上写的步骤按ctrl+shift+P打开命令面板,输入install,鼠标点击 ...
- Win 2008 R2安装SQL Server 2008“性能计数器注册表配置单元一致性”失败的解决办法
Win 2008 R2安装SQL Server 2008“性能计数器注册表配置单元一致性”失败的解决办法(2011-02-23 19:37:32) 转载▼ 今天在惠普服务器上安装数据库2008时, ...
- WIN8.1的安装和打开"这台电脑"速度很慢的解决办法
WIN8.1的安装和打开"这台电脑"速度很慢的解决办法 对于非服务器用的电脑,如果电脑的内存在2G或更高,首推的操作系统是 WINDOWS8.1 64位企业版,用了就知道,没有比这流畅懂事的操作系统. ...
- Mac系统安装文件提示文件已损坏,打不开解决办法
Mac系统安装文件提示文件已损坏,打不开解决办法: 修改系统配置:系统偏好设置 - 安全性与隐私 - 任何来源”.如果没有“任何来源”这个选项,是因为你的系统是macOS Sierra 10.12,苹 ...
- winows8.1或winows7 64bit 安装Itunes 64bit 11.1.3 无法打开一直停止工作的解决办法
winows8.1或winows7 64bit 安装Itunes 64bit 11.1.3 无法打开一直停止工作的解决办法 系统环境变量里的Path追加 ;C:\program files (x86) ...
- gVim安装vim-template插件后提示Undefined variable vim_template_subtype/Press ENTER or type command to continue
Win7 64位 gVim:version 8.1.1234 vim-template:github链接 安装方式: 直接下载master的zip压缩包,解压后放入本地gVim安装目录的plugin, ...
随机推荐
- 标签data-*属性使用
<div class="page_index" style="margin-top:20px;"> <span id="showPa ...
- 转载:GridControl使用技巧
一.如何解决单击记录整行选中的问题 View->OptionsBehavior->EditorShowMode 设置为:Click 二.如何新增一条记录 (1).gridView.AddN ...
- Android MP3录音实现
给APP做语音功能,必须考虑到IOS和Android平台的通用性.wav录音质量高,文件太大,AAC和AMR格式在IOS平台却不支持,所以采用libmp3lame把AudioRecord音频流直接转换 ...
- 一些小题<代码>
1.用传统方法计算一个数的二进制 1.只能计算小于2**16的数字 i = 17 num_2 = int(input("输入一个数字:").strip()) while True: ...
- js日期字符串增加天数的函数
//日期加天数的方法 //dataStr日期字符串 //dayCount 要增加的天数 //return 增加n天后的日期字符串 function dateAddDays(dataStr,dayCou ...
- Leetcode: 4Sum II
Given four lists A, B, C, D of integer values, compute how many tuples (i, j, k, l) there are such t ...
- sprint演示
- axure rp pro 7.0(页面原型工具)
axure rp pro 7.0 下载连接:地址
- [CrunchBang]修改win+ubuntu 双 系统菜单的 启动顺序 引导
说到启动就不得不说GRUB,Linux下大名鼎鼎的启动管理工具(曾经的LILO已经风光不再),当然现在已经是GRUB2了,GRUB2和GRUB最重要的区别就是,GRUB存放系统启动信息的文件为/boo ...
- PHP中fopen,file_get_contents,curl函数的区别
PHP中fopen,file_get_contents,curl函数的区别 1.fopen/file_get_contents每次请求都做DNS查询,并不对DNS的信息进行缓存,而curl会对DNS的 ...