Bobcares

How to fix proc_open() fork failed

by | May 23, 2020

Many website owners face the error “proc_open(): fork failed – Cannot allocate memory” while installing PHP frameworks or packages.

Most of the PHP frameworks use “composer” as the dependency management tool, which throws this error during insufficient memory and improper swap space allocation.

At Bobcares, we often resolve similar support requests from webmasters, web hosts, and other online service providers as part of our Server Management Services.

Read more to know what causes this error and what we can do to prevent it in the future.

Why this proc_open() fork failed error occur?

PHP framework like Laravel works with the help of Composer. It is a major dependency on creating Laravel projects. Because it declares the libraries needed for the project.

We can install all the new packages required for the  application using the command:

composer install

In order to add any new package to the application, we use the command:

composer require <package>

But running this command sometimes ends up in errors.

One such error is “proc_open(): fork failed – Cannot allocate memory”.

The main reasons for this error to occur are insufficient memory and improper swap space allocation.

proc_open() fork failed

Let’s see how to fix it.

 

What is the fix for proc_open() fork failed error?

When this error appears, the first thing to check is the available memory in the server. To find it out, use the command:

free -m

The result provides details like total, used, and free spaces in the server. Also, this provides data regarding available swap space in the server.

The error appears while installing new packages if there is no free space available.

In such scenarios, we ask customers to add more memory for fixing the error.

However, there are cases where this error appears even if there is enough space.

In such a case, we check the allocated swap space in the server.

Because, if there is no free swap space, some installation could not be completed and end up showing this error.

We use the commands below for enabling the swap space in such a scenario.

/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
/sbin/mkswap /var/swap.1
/sbin/swapon /var/swap.1

This fixes the error.

 

[Need assistance in fixing composer errors? Click here to talk to our experts.]

 

Conclusion

In short, we discussed in detail that the main reasons for proc_open() fork failed error to occur are insufficient memory and improper swap space allocation. We also discussed how our Support Engineers fix this error easily.

 

 

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF