Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Nov 2006
    Location
    Sofia, Bulgaria
    Posts
    18

    Default Unable to recompile php 5.3.2 with fileinfo

    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:
    Quote Originally Posted by ulimit -a
    root@server1 [~]# 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:
    Quote Originally Posted by /bin/sh -c "ulimit -a"
    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

  2. #2
    BANNED
    Join Date
    Jun 2005
    Location
    Wild Wild West
    Posts
    2,025

    Default

    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.

  3. #3
    Member
    Join Date
    Nov 2006
    Location
    Sofia, Bulgaria
    Posts
    18

    Default

    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 by kenashkov; 05-11-2010 at 12:15 PM.

  4. #4
    BANNED
    Join Date
    Jun 2005
    Location
    Wild Wild West
    Posts
    2,025

    Default

    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)

  5. #5
    Member
    Join Date
    Nov 2006
    Location
    Sofia, Bulgaria
    Posts
    18

    Default

    Just tried php 5.3.1 - the same error:
    Quote Originally Posted by easyapache
    virtual memory exhausted: Cannot allocate memory
    make: *** [ext/fileinfo/libmagic/apprentice.lo] Error 1
    !! 'make' failed with exit code '512' !!
    The configure command is:
    Quote Originally Posted by configure
    ./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

Similar Threads & Tags
Similar threads

  1. Recompile on PHP
    By robthemanbob in forum New User Questions
    Replies: 2
    Last Post: 03-12-2009, 03:41 PM
  2. PHP Recompile
    By jmetcalf in forum cPanel and WHM Discussions
    Replies: 19
    Last Post: 06-12-2008, 08:42 AM
  3. How to recompile PHP
    By ahostli in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 08-28-2006, 10:18 PM
  4. Just recompile only PHP
    By benito in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 03-17-2006, 11:48 AM
  5. Recompile PHP ...Please help
    By evolver in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 06-08-2003, 04:27 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube