Compile and install PHP when you encounter virtual memory Exhausted:cannot allocate memory

Source: Internet
Author: User
Tags vps
Compile and install PHP when you encounter virtual memory Exhausted:cannot allocate memory

Sometimes when you build a VPS, you need to install the host Control Panel by compiling it. For large-memory VPS, the general problem is not big, but for small memory, such as 512MB of memory VPS, there is likely to be a problem, because the compilation process is a large memory consumption action.
I recently encountered a problem such as: In the 512MB memory CentOS operating system VPS on the installation of a domestic host control Panel, the compilation and installation of PHP when the log has the following error record:
Virtual Memory Exhausted:cannot Allocate memory
Make: * * * [Ext/fileinfo/libmagic/apprentice.lo] Error 1

The first solution is to close a lot of processes first, such as httpd, FTPD, SendMail, and so on, releasing a portion of the memory, and then compiling, still get the same compilation error. Later Baidu Google a long time to find a solution to the problem, but also found on the Php.net solution, the original link is: https:? bugs.php.net/bug.php?id=48809

Workaround:

Add quotation marks to the PHP installation configuration file (excluding quotation marks) "--disable-fileinfo"

then re-compile the installation and finally compile the pass.

  • 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.