Join the community today
Register Now

How to compile php 7.4 with less of 1GB ram?

Discussion in 'Install & Upgrades or Pre-Install Questions' started by Sysnet, Nov 17, 2020.

  1. Sysnet

    Sysnet New Member

    4
    0
    1
    Nov 17, 2020
    Ratings:
    +0
    Local Time:
    1:22 PM
    Hello eva2000, first a big thank you for create this software centminmod.
    Maybe it's not the correct place to publish this post

    I have a question related to compile php 7.4, with 1cpu and 1GB ram, I get this error

    virtual memory exhausted: Cannot allocate memory
    Makefile:880: recipe for target 'ext/fileinfo/libmagic/apprentice.lo' failed
    make: *** [ext/fileinfo/libmagic/apprentice.lo] Error 1

    The error go away when I used 2GB ram, the process I compile is

    git clone http://git.php.net/repository/php-src.git
    cd php-src
    ./buildconf
    ./configure --enable-maintainer-zts \
    --enable-debug \
    --enable-cli \
    --enable-fpm

    make
    make install

    I learning how to compile php, this is not related to centminmod


    my features is:
    digital ocean
    ubuntu 20

    will you be a dear to give me your opinion about this case, is possible to compile with less of 1gb ram?

    thank you
     
  2. steph40

    steph40 Member

    79
    15
    8
    Jan 28, 2019
    Ratings:
    +32
    Local Time:
    1:22 PM
    1.1.5
    mariadb 10
    Is that installing centminmod with php 7.4 or just php 7.4 with something else then centminmod.
    I just installed centminmid with php 7.4.12 on a 1 cpu 1gb vps with no issues.
     
  3. Sysnet

    Sysnet New Member

    4
    0
    1
    Nov 17, 2020
    Ratings:
    +0
    Local Time:
    1:22 PM
    thanks for your input, the compile process is done in ubuntu 20, the server is clean just tried to compile php
     
  4. steph40

    steph40 Member

    79
    15
    8
    Jan 28, 2019
    Ratings:
    +32
    Local Time:
    1:22 PM
    1.1.5
    mariadb 10
    Centminmod is only for centos 7 not Ubuntu.

    But maybe someone else has some input.
     
  5. Meirami

    Meirami Active Member

    151
    26
    28
    Dec 21, 2017
    Ratings:
    +61
    Local Time:
    8:22 PM
    Try to stop all the processes you don't need when compiling. Hopefully you'll get enough free mem.
     
  6. eva2000

    eva2000 Administrator Staff Member

    45,662
    10,360
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,079
    Local Time:
    4:22 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    This forum is for Centmin Mod related discussions which would be CentOS based. Not for Ubuntu. PHP compilations with fileinfo extension have very high memory usage requirements i.e. at least 1.6GB which is why Centmin Mod by default doesn't include fileinfo extension in it's compilations unless memory requirements are met i.e. if you don't have at least => 1023000 bytes swap file size and 1GB of memory. If you want to compile with fileinfo extension, have a large swap disk if you don't have enough memory but compilation will be slow if hitting swap disk.
     
  7. Sysnet

    Sysnet New Member

    4
    0
    1
    Nov 17, 2020
    Ratings:
    +0
    Local Time:
    1:22 PM
    Thank you