The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Enabling PHP memory limit - anyone done so?

Discussion in 'General Discussion' started by webignition, Jan 24, 2005.

  1. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    Hi,

    First of all, I'd like to apologise for posting this since I notice this topic has been covered before, although not to any really satisfactory degree.

    I notice that the configuration of PHP from easyapache doesn't include --enable-memory-limit and I understand that I'd have to configure and compile PHP myself to enable this.

    The problem is that I'm quite a newbie to this subject and can't find any clear instructions for how to do this correctly.

    Since many other people would have to have dealt with this problem, there would be someone who has done so and could explain to me in simple steps how to configure PHP by simply modifying the existing config to include --enable-memory-limit.

    I have read through the instructions of how to configure PHP from the PHP website and tried to configure PHP myself but to no avail and I don't really know why or how to make it work correctly.

    What I did was:

    1. Run phpinfo() and copy the current configuration command

    2. Add '--enable-memory-limit' to the end of the existing configuration command (minus the './configure' that phpinfo() adds to the start i.e. so it just includes all the --with and --enable options)

    3. SSH to my server and type:

    Code:
    cd /home/cpapachebuild/buildapache/php-4.3.10/
    ./configure '--with-apxs=/usr/local/apache/bin/apxs' '--with-xml' '--enable-bcmath' '--enable-calendar' '--enable-exif' '--enable-ftp' '--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--with-imap' '--with-imap-ssl' '--with-kerberos' '--enable-magic-quotes' '--with-mysql' '--with-openssl' '--enable-discard-path' '--with-pear' '--enable-sockets' '--enable-track-vars' '--with-ttf' '--with-freetype-dir=/usr' '--enable-gd-native-ttf' '--enable-versioning' '--with-xmlrpc' '--with-zlib' '--enable-memory-limit'
    This seemed to go OK, i.e. it didn't clearly state anything that I could identify as being wrong!

    I then typed:

    Code:
    make
    This output a lot of data that ended with:

    Code:
    ext/openssl/openssl.lo: file not recognized: File truncated
    collect2: ld returned 1 exit status
    make: *** [libphp4.la] Error 1
    All I can determine from this is that it didn't like some file related to the integration of openssl and so it failed.

    What I can't figure out is:

    1. Why it failed, since it uses the same configure command as phpinfo() displays.
    2. What I can do about this

    I also tried removing '--with-openssl' to see what happens, but when running 'make' it returns a similar error as above but regarding zlib:

    Code:
    ext/zlib/zlib.lo: file not recognized: File truncated
    collect2: ld returned 1 exit status
    make: *** [libphp4.la] Error 1
    Clearly I'm doing something wrong, but I don't know enough to know what and was hoping someone could make some kind suggestions?

    Thanks,

    Jon
     
  2. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider
    Option added to latest buildapache as experimental
     
  3. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    Excellent, and how do I . . .

    Thanks cpanelnick, thats by far the best thing I've heard in decades!!

    As for getting the lastest version of buildapache, how would I go about that and how would I used it?

    I'm currently using version 10.0.0-R7 of WHM/Cpanel and using the option to build apache from there, which doesn't offer the option of enabling the memory limit.

    Sorry to ask what might seem like a strange question, but I'm still getting to grips with things and am still quite a newbie in this area.

    If you could just point out what I'd have to do, either through WHM or from an SSH window, I'll be fine and will never have to ask again!
     
  4. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    Sorry

    I'm certain the option wasn't there before but is now . . .

    Silly me. Thanks again!
     
Loading...

Share This Page