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
Based on the method in this article, the PHP installation configuration file is quoted in the configuration (not including quotation marks) "--disable-fileinfo" after finally compiled through. Share it here for your reference.
PHP Compilation: Virtual memory Exhausted:cannot Allocate memory