Home > Development Tools > composer > How to solve the error proc_open(): fork failed - Cannot allocate memory after installing composer

How to solve the error proc_open(): fork failed - Cannot allocate memory after installing composer

藏色散人
Release: 2021-03-04 11:40:22
forward
2661 people have browsed it

The following tutorial column of composer will introduce you to the solution to the error proc_open(): fork failed - Cannot allocate memory after installing composer. I hope it will be helpful to friends in need!

How to solve the error proc_open(): fork failed - Cannot allocate memory after installing composer

After installing composer, the error proc_open(): fork failed - Cannot allocate memory

1. Problem Description:

When using composer to deploy the yii project on the Linux server, "proc_open(): fork failed - Cannot allocate memory"

is the prompt" Prompt "Insufficient Memory", we can solve this problem by creating a swap partition.

2. Solution:

  • First run free -m to see how much space there is
  • in the command line environment in sequence Run the following three commands
dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
mkswap /var/swap.1
swapon /var/swap.1
Copy after login
  • Example: [The following is the result of my running on the server]
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, 10.0607 s, 107 MB/s    //这个是返回的内容
Copy after login
mkswap /var/swap.1   //第二条指令
Setting up swapspace version 1, size = 1048572 KiB   //这个是返回的内容
no label, UUID=f6280c41-21b4-4039-bc3e-c26284b47b0c   //这个是返回的内容
Copy after login
swapon /var/swap.1  //第三条指令
swapon: /var/swap.1: insecure permissions 0644, 0600 suggested.   //这个是返回的内容
Copy after login
  • Explanation:
dd 从/dev/zero设备复制出一个1G大小的文件/var/swap.1

mkswap 格式化/var/swap.1

swapon 将swap分区挂在到文件系统

然后输入free -m 查看内存使用量信息
Copy after login
  • Finally, execute composer update again and it will be successful.

The above is the detailed content of How to solve the error proc_open(): fork failed - Cannot allocate memory after installing composer. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template