编译安装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

你可能感兴趣的:(php)