Unable to recompile php 5.3.2 with fileinfo

kenashkov

Active Member
Nov 23, 2006
33
0
156
Sofia, Bulgaria
cPanel Access Level
Root Administrator
Hello,

I'm trying to recompile php 5.3.2 with fileinfo enabled but without any success - always getting error about insufficient memory... I know it may require up to 1GB so I changed the limitations using ulimit and I've put in both .bashrc and .bash_profile:
ulimit -v unlimited
ulimit -m unlimited
Additionally the setting "The maximum memory a cPanel process can use before it is killed off (in megabytes)" is set to 1024MB. Here is the output from ulimit -a:
ulimit -a said:
[email protected] [~]# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
pending signals (-i) 16126
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 16126
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
Still when I start /scripts/easyapache from command line it always prints:
/bin/sh -c "ulimit -a" said:
Ouput from '/bin/sh -c "ulimit -a"':
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
pending signals (-i) 16126
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) 524288
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 16126
virtual memory (kbytes, -v) 524288
file locks (-x) unlimited
Why virtual memory and max memory size are still 512MB ? I couldn't find any way around this and I always get out of memory error when the compile process reaches fileinfo extension. Any help would be greatly appreciated.

Vesko Kenashkov
 

Spiral

BANNED
Jun 24, 2005
2,018
8
193
Are you a software developer or otherwise have some specific need to be running PHP 5.3.2?

If not then I would [/b]STRONGLY RECOMMEND[/b] you use PHP 5.2.13 instead.

The vast majority of applications out there are still not updated to work with PHP 5.3.x and since this version series breaks backwards compatibility, it's not a good idea to be running it in any production hosting environment at least not until there is a lot more widespread software and script support than there is presently.

Regarding your resource question, you haven't really said anything about your server details which would also probably help substantially as you may have other resource issues other than where you are looking at the moment per your post.
 

kenashkov

Active Member
Nov 23, 2006
33
0
156
Sofia, Bulgaria
cPanel Access Level
Root Administrator
The server has 2GB physical memory and 2GB swap. This should be enough and that is why I didn't think that the physical/virtual memory in this setup could be the reason. I think that for some reason easyapache script is limited by the limitations posed by ulimit and that is why I tried by all means to change them... of course I may be wrong (and even if I'm right I still don't know how to remove this limitation).

I'm developing for PHP 5.3 for 2 years already (yes, before even it got in alpha version when was using the old namespace separator :: ), so it is imperative for me to upgrade this server. The features php 5.3 provides are of a great benefit - namespaces, LSB allows for proper singleton implementation (just to name the main reasons). In fact I need fileinfo for an older app written for php 5.2 that uses it and is hosted on this server (otherwise it is fully compatible with 5.3). So that is my story...

In fact the server at the moment is using successfully php 5.3.2 (its running without fileinfo extension) without any compatibility issues except this.

If any other data/settings/output would be useful I will provide it...

P.S. actually I havent tried php 5.3.1 with fileinfo (I just didn't have much hope that it will pass and it is generally better for security reasons to run the latest version)
 
Last edited:

Spiral

BANNED
Jun 24, 2005
2,018
8
193
Well thanks for actually verifying everything I just said about backwards compatibility in a weird round about reverse kind of way ;)

Anyway though ....

You really shouldn't be running into resource issues at compile time only at execution time so I'm not sure script limits would really be an issue much in this instance.

I would assume you already checked the EasyApache output, does that tell you anything useful?

(If not, check out the newest files under /usr/local/cpanel/logs/easy/apache)
 

kenashkov

Active Member
Nov 23, 2006
33
0
156
Sofia, Bulgaria
cPanel Access Level
Root Administrator
Just tried php 5.3.1 - the same error:
easyapache said:
virtual memory exhausted: Cannot allocate memory
make: *** [ext/fileinfo/libmagic/apprentice.lo] Error 1
!! 'make' failed with exit code '512' !!
The configure command is:
configure said:
./configure
--enable-bcmath
--enable-calendar
--enable-exif
--enable-ftp
--enable-gd-native-ttf
--enable-intl
--enable-libxml
--enable-magic-quotes
--enable-mbstring
--enable-pdo=shared
--enable-soap
--enable-sockets
--enable-zend-multibyte
--enable-zip
--prefix=/usr/local
--with-apxs2=/usr/local/apache/bin/apxs
--with-bz2
--with-curl=/opt/curlssl/
--with-curlwrappers
--with-freetype-dir=/usr
--with-gd
--with-gettext
--with-icu-dir=/usr
--with-imap=/opt/php_with_imap_client/
--with-imap-ssl=/opt/openssl
--with-jpeg-dir=/usr
--with-kerberos
--with-libdir=lib64
--with-libexpat-dir=/usr
--with-libxml-dir=/opt/xml2
--with-libxml-dir=/opt/xml2/
--with-mcrypt=/opt/libmcrypt/
--with-mysql=/usr
--with-mysql-sock=/var/lib/mysql/mysql.sock
--with-mysqli=/usr/bin/mysql_config
--with-openssl=/opt/openssl
--with-openssl-dir=/opt/openssl
--with-pcre-regex=/opt/pcre
--with-pdo-mysql=shared
--with-pdo-sqlite=shared
--with-pgsql=/usr
--with-pic
--with-png-dir=/usr
--with-sqlite=shared
--with-tidy=/opt/tidy/
--with-xmlrpc
--with-xpm-dir=/usr/X11R6
--with-xsl=/opt/xslt/
--with-zlib
--with-zlib-dir=/usr