ID: 48809 User updated by: ibboard at gmail dot com Reported By: ibboard at gmail dot com Status: Wont fix Bug Type: Compile Failure Operating System: CentOS 4 PHP Version: 5.3.0 New Comment:
"Quite a bit" of memory? That seems like a bit of an understatement when it will quite happily consume over 350MB of memory on a single file and previous versions of PHP could be compiled in ~150MB or less (albeit without that extension) :D Maybe libmagic needs disabling as a default module if it was in PECL before and is known to causes problems with older compilers? How much memory am I expected to need to compile it if it fails with 350MB? I've just watched 'top' while the compile continued and it maxed out at ~120MB without libmagic, which is far more reasonable. Previous Comments: ------------------------------------------------------------------------ [2009-07-05 19:08:30] ras...@php.net We know that file takes quite a bit of memory to compile on older versions of gcc. It should be better in newer versions though. Not much we can do about this. We aren't going to change perfectly valid code just because some older compilers have trouble with it. ------------------------------------------------------------------------ [2009-07-05 19:05:08] ibboard at gmail dot com Description: ------------ I'm trying to compile PHP 5.3 on a VPS with 256MB of memory, but I keep getting "out of memory" errors before 'make' completes. I've compiled 5.2.x on the VPS before and I've freed up over 170MB of my 256MB of memory, but still I get the following error (always the same file): virtual memory exhausted: Cannot allocate memory make: *** [ext/fileinfo/libmagic/apprentice.lo] Error 1 My host temporarily bumped my account up to 512MB of memory, but it still took all of the free memory before failing (350MB+). Disabling the extension that the file is from with "--disable-fileinfo" gets me beyond the error and continues without running out of memory (until it hits a different error in libgd, which I'm looking in to). May be similar to http://bugs.php.net/bug.php?id=48593, but crashes out with insufficient memory rather than hanging indefinitely. Reproduce code: --------------- $ wget http://uk2.php.net/get/php-5.3.0.tar.bz2/from/this/mirror $ tar -xjvf php-5.3.0.tar.bz2 $ cd php-5.3.0 $ ./configure --prefix=/usr/local/php5-fcgi --with-kerberos=/opt --with-layout=GNU --with-regex=php --with-gettext --enable-mbstring --enable-libxml --with-pcre-regex=/opt --with-imap=shared --with-imap-ssl --with-mysql=shared,/opt --with-mysqli=shared,/usr/bin/mysql_config --with-mysql-sock=/var/lib/mysql/mysql.sock --with-libxml-dir=/opt --enable-gd-native-ttf --with-gd=/opt --with-jpeg-dir=/opt --with-freetype-dir=/opt --with-mcrypt --with-zlib-dir=/opt --with-png-dir=/opt --with-config-file-scan-dir=/usr/local/etc/php.d $ make Expected result: ---------------- PHP compile to complete so that I can run "sudo make install". Actual result: -------------- [lots of compile output] ... /bin/sh /home/ibb_admin/temp/php-5.3.0/libtool --silent --preserve-dup-deps --mode=compile gcc -I/home/ibb_admin/temp/php-5.3.0/ext/fileinfo/libmagic -Iext/fileinfo/ -I/home/ibb_admin/temp/php-5.3.0/ext/fileinfo/ -DPHP_ATOM_INC -I/home/ibb_admin/temp/php-5.3.0/include -I/home/ibb_admin/temp/php-5.3.0/main -I/home/ibb_admin/temp/php-5.3.0 -I/home/ibb_admin/temp/php-5.3.0/ext/date/lib -I/home/ibb_admin/temp/php-5.3.0/ext/ereg/regex -I/usr/include/libxml2 -I/opt/include -I/opt/include/freetype2 -I/usr/include/imap -I/usr/kerberos/include -I/home/ibb_admin/temp/php-5.3.0/ext/mbstring/oniguruma -I/home/ibb_admin/temp/php-5.3.0/ext/mbstring/libmbfl -I/home/ibb_admin/temp/php-5.3.0/ext/mbstring/libmbfl/mbfl -I/opt/include/mysql -I/usr/include/mysql -I/home/ibb_admin/temp/php-5.3.0/ext/sqlite3/libsqlite -I/home/ibb_admin/temp/php-5.3.0/TSRM -I/home/ibb_admin/temp/php-5.3.0/Zend -I/usr/include -g -O2 -c /home/ibb_admin/temp/php-5.3.0/ext/fileinfo/libmagic/apprentice.c -o ext/fileinfo/libmagic/apprentice.lo virtual memory exhausted: Cannot allocate memory make: *** [ext/fileinfo/libmagic/apprentice.lo] Error 1 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48809&edit=1