Virtualmemoryexhausted: cannotallocatemory

Source: Internet
Author: User
Tags vps
When compiling and installing php, virtualmemoryexhausted: Cannotallocatememory sometimes needs to be compiled to install the host control panel when using vps to build a website. For VPS with large memory, it is generally not a problem, but for small memory, such as VPS with MB memory, it is very likely that there will be problems, because virtual memory exhausted is encountered during php compilation and installation: cannot allocate memory

Sometimes, you need to compile the host control panel to build a website using vps. For VPS with large memory, it is generally not a problem, but for small memory, such as VPS with MB memory, it is very likely that the compilation process is a large memory consumption action.
I recently encountered such a problem: compile and install a domestic host control panel on the VPS of the centos 512MB memory. the following error records are displayed in the logs when compiling and installing php:
Virtual memory exhausted: Cannot allocate memory
Make: *** [ext/fileinfo/libmagic/apprentice. lo] Error 1

At the beginning, the solution is to first shut down many processes, such as httpd, ftpd, and sendmail, and release some of the memory before compilation, and still get the same compilation error. Later, Baidu Google found a solution to the problem after a long time, and found a solution on php.net. The original article link is: https :? // Bugs.php.net/bug.php? Id = 48809

Solution:

Add the configuration (excluding the quotation marks) "-- disable-fileinfo" in the php installation configuration file"

Then re-compile and install it, and finally compile it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.