编译安装php时遇到virtual memory exhausted: Cannot allocate memory

编译安装php时遇到virtual memory exhausted: Cannot allocate memory

解决方法:

将php安装配置文件中加了引号中的配置--disable-fileinfo

即在执行 ./configure 时加上 --disable-fileinfo 参数

清除原编译  make clean

重新生成makefile文件

./configure --prefix=/usr/local/php7  --with-apxs2=/usr/local/apache/bin/apxs  --with-curl  --with-freetype-dir  --with-gd  --with-gettext  --with-iconv-dir  --with-kerberos  --with-libdir=lib64  --with-libxml-dir  --with-mysqli  --with-openssl  --with-pcre-regex  --with-pdo-mysql  --with-pdo-sqlite  --with-pear  --with-png-dir  --with-xmlrpc  --with-xsl  --with-zlib  --enable-fpm  --enable-bcmath  --enable-libxml  --enable-inline-optimization  --enable-gd-native-ttf  --enable-mbregex  --enable-mbstring  --enable-opcache  --enable-pcntl  --enable-shmop  --enable-soap  --enable-sockets  --enable-sysvsem  --enable-xml  --enable-zip --disable-fileinfo
然后 make && make install

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
"Cannot allocate memory"是一个常见的错误消息,它表示系统无法分配足够的内存来执行所需的操作。这种错误通常出现在系统资源不足或内存泄漏的情况下。根据引用,在编译过程中出现"virtual memory exhausted Cannot allocate memory"错误可能意味着编译器尝试分配的内存超出了系统的可用内存限制。 另一方面,根据引用,如果在终端中出现"-bash: fork: Cannot allocate memory"错误,则可能是由于系统进程数过多导致的。这可能意味着系统资源不足,无法再创建更多的进程。 为了解决这个问题,可以尝试以下方法: 1. 增加系统的可用内存:可以通过增加服务器的物理内存或调整虚拟内存设置来增加可用内存。 2. 优化进程和资源使用:检查系统中运行的进程和服务,确保它们的资源使用合理。关闭不必要的进程可以释放内存和其他资源。 3. 优化代码和程序:对于编译过程中出现的错误,可以尝试优化代码、减少内存使用或使用更高效的算法来降低内存消耗。 综上所述,"cannot allocate memory"错误通常是由系统资源不足或内存泄漏引起的。通过增加可用内存、优化进程和资源使用以及优化代码和程序,可以解决这个问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [编译virtual memory exhausted Cannot allocate memory 内存增加.docx](https://download.csdn.net/download/zhangao_fengg/75990874)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* *3* [-bash: fork: Cannot allocate memory问题,进程数满了的解决办法](https://blog.csdn.net/weixin_30517001/article/details/98797194)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值