Learn about Centmin Mod LEMP Stack today
Become a Member

Install Install Centmin Success but cant install composer | php

Discussion in 'Install & Upgrades or Pre-Install Questions' started by chorong91, Jul 6, 2016.

  1. chorong91

    chorong91 New Member

    16
    2
    3
    Dec 1, 2015
    Ratings:
    +2
    Local Time:
    4:55 PM
    I had a VPS on Vultr with OS CentOS 6 x64, and
    VPS on DO with OS CentOS 7.2 x64
    NB: Both already apc.enable_cli = Off

    I install centmin and run with no problem:
    curl -sS https://getcomposer.org/installer | php

    but now I had VPS on DigitalOcean with OS CentOS 7.2 x64
    I install centmin with no problem but i had problem when run:
    curl -sS https://getcomposer.org/installer | php
    with error php command not found (I cant run php and php -v) but i can run whereis php

    (I had solve this problem with remove yum.conf exclude *php and install php with yum)
    (then I check my VPS on Vultr I yum.conf still exclude *php and I had no command to install my PHP but it works and nprestart work in no time)
    my VPS on DO works if I install php with yum manually but I had long time to nprestart and I see this line: Gracefully shutting down php-fpm -kill
    so I doubt with my centmin installation I doubt sometimes it get problems.

    then I try to downgrade my CentOS to 6.7 x64 version (because DO dont have CentOS 6 x64)
    I try to install Centmin.. but it's not work at all. installation stop at :
    =================
    Transaction Summary
    ================================================================================
    Install 6 Package(s)

    Total download size: 80 M
    Downloading Packages:
    =================

    What should I do? did I install it wrong?
     
  2. eva2000

    eva2000 Administrator Staff Member

    29,053
    6,594
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,790
    Local Time:
    4:55 PM
    Nginx 1.13.x
    MariaDB 5.5
    Centmin mod won't work with yum installed php, it has to be source compiled php via centmin.sh. Sounds like the initial centmin mod install on DO failed to properly install php. You can check install log for initial install in /etc/centminlogs for clues as to why php failed to install as per initial install troubleshooting guide below.

    You'll need to post on the forums with the following info
    • Server or VPS details ? XEN, KVM, OpenVZ, VMWare or dedicated server ? OS ? CentOS 6.7 or 7.2 ? 32bit or 64bit ?
    • What version of Centmin Mod ? .07 stable or 08 stable or .09 beta01 or another branch version ?
    • Was it fresh install or upgrade ?
    • Method of install ? Via centmin.sh menu option 1, Git install or curl one liner install as outlined at centminmod.com/download.html ?
    • How long ago did you install Centmin Mod ?
    • There's numerous code changes, bug fixes over time, so ensure you have latest Centmin Mod code installed by upgrading your Centmin Mod code as instructed below.

    Troubleshooting Initial Install



    To troubleshoot initial installation, you need to check the initial install log at /root/centminlogs and instructions under Sharing logs and errors heading for using Pastebin.com or Gists to share a sanitised version of the contents of the initial install log. You can see full details at How to troubleshoot Centmin Mod initial install issues

    If it's possible to reload and reinstall clean fresh CentOS image, you can try a fresh install and make sure php is installed and working first.
     
  3. chorong91

    chorong91 New Member

    16
    2
    3
    Dec 1, 2015
    Ratings:
    +2
    Local Time:
    4:55 PM
    why i cant see centminlogs at /etc ?
    • Server or VPS details ? XEN, KVM, OpenVZ, VMWare or dedicated server ? OS ? CentOS 6.7 or 7.2 ? 32bit or 64bit ?
    • Im Using VPS at DigitalOcean spec : 512 MB Memory / 20 GB Disk / SGP1 - CentOS 7.2 x64
    • What version of Centmin Mod ? .07 stable or 08 stable or .09 beta01 or another branch version ?
    • 123.08stable
    • Was it fresh install or upgrade ?
    • fresh install
    • Method of install ? Via centmin.sh menu option 1, Git install or curl one liner install as outlined atcentminmod.com/download.html ?
    • ./centmin.sh install
    • How long ago did you install Centmin Mod ?
    • I had installed 1 on Vultr about 6 month ago?
     
  4. eva2000

    eva2000 Administrator Staff Member

    29,053
    6,594
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,790
    Local Time:
    4:55 PM
    Nginx 1.13.x
    MariaDB 5.5
    you can't see logs at /root/centminlogs ?

    as root use in SSH type
    Code (Text):
    ls -lAhrt  /root/centminlogs

    find the install log and cat output or download file and copy and paste contents to pastebin.com or gist.github.com
    example list log files
    Code (Text):
    ls -lAhrt  /root/centminlogs | grep '_install.log'
    -rw-r--r--. 1 root root 2.3M May 20 18:08 centminmod_1.2.3-eva2000.09.001_200516-133248_install.log

    cat output
    Code (Text):
    cat  /root/centminlogs/centminmod_1.2.3-eva2000.09.001_200516-133248_install.log

    which you copy and paste or save log locally
     
  5. chorong91

    chorong91 New Member

    16
    2
    3
    Dec 1, 2015
    Ratings:
    +2
    Local Time:
    4:55 PM
    Install log here:
    Dropbox - log.txt
    centminmod has no problem with centos 7.2 x64 right?
     
  6. eva2000

    eva2000 Administrator Staff Member

    29,053
    6,594
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,790
    Local Time:
    4:55 PM
    Nginx 1.13.x
    MariaDB 5.5
    Yes centmin mod works with both centos 6 and centos 7.

    from your install log, both nginx and php-fpm failed to install as seen in post-install check output
    Code (Text):
    [1;33;40m--------------------------------------------------------
    [0;10m[1;33;40mCheck Nginx Version:
    [0;10m[1;33;40m--------------------------------------------------------
    [0;10minc/centminfinish.inc: line 49: nginx: command not found
    
    [1;33;40m--------------------------------------------------------
    [0;10m[1;33;40mCheck PHP-FPM Version:
    [0;10m[1;33;40m--------------------------------------------------------
    [0;10minc/centminfinish.inc: line 55: php: command not found

    nginx failed as you hit a 123.08stable nginx 1.11.2 bug which i just fixed at Centmin Mod 123.08stable update for Nginx 1.11.2 compatibility.
    Code (Text):
    ../nginx-accesskey-2.0.3/ngx_http_accesskey_module.c:14:10: fatal error: 'md5.h' file not found
    #include <md5.h>
             ^
    1 error generated.
    make[1]: *** [objs/addon/nginx-accesskey-2.0.3/ngx_http_accesskey_module.o] Error 1
    make[1]: *** Waiting for unfinished jobs....
    make[1]: Leaving directory `/svr-setup/nginx-1.11.2'
    make: *** [build] Error 2

    php failed to compile as you ran out of available memory also FYI, PHP 7.0.8 is latest
    Code (Text):
    virtual memory exhausted: Cannot allocate memory
    make: *** [ext/fileinfo/libmagic/apprentice.lo] Error 1
    

    Reason is minimum system requirements for CentOS 7 is 1GB memory as per Raising minimum & recommended disk requirements for Centmin Mod LEMP installs | Centmin Mod Community and download page at centminmod.com/download.html

    If you use 512MB VPS, use CentOS 6.x instead
     
  7. chorong91

    chorong91 New Member

    16
    2
    3
    Dec 1, 2015
    Ratings:
    +2
    Local Time:
    4:55 PM
    DO had CentOS 6.7 x64 ,6.8 x64

    I install it on 6.8 x64
    and still get same error. you can check log here:
    Dropbox - centmin install log on centos 6.8 x64.txt
     
    Last edited: Jul 6, 2016
  8. eva2000

    eva2000 Administrator Staff Member

    29,053
    6,594
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,790
    Local Time:
    4:55 PM
    Nginx 1.13.x
    MariaDB 5.5
    similar error which basically means php compile terminated due to low system available memory as fileinfo php module is very memory intensive for compilation and 123.08stable doesn't have same 123.09beta01 auto detection routine. In 123.09beta01 i have coded a system available memory detection routine to check if system memory is available. If not enough memory, it will auto disable just php fileinfo extension. This you can see in 123.09beta01's inc/php_configure.inc lines 141-145 and line 11 defines the low memory threshold as below 530000 bytes
    Code (Text):
    -c /svr-setup/php-7.0.8/ext/fileinfo/libmagic/apprentice.c -o ext/fileinfo/libmagic/apprentice.lo
    gcc: Internal error: Killed (program cc1)
    Please submit a full bug report.
    See <http://bugzilla.redhat.com/bugzilla> for instructions.
    make: *** [ext/fileinfo/libmagic/apprentice.lo] Error 1


    I'd recommend you use centmin mod 123.09beta01 instead for now Beta Branch - Centmin Mod .09 beta branch Testing | Centmin Mod Community however seems 123.08stable version also has this routine check centminmod/php_configure.inc at 123.08stable · centminmod/centminmod · GitHub so will need to see why - maybe i need to increase the low memory threshold value

    install default php 5.6.x latest
    Code (Text):
    yum -y update; curl -O https://centminmod.com/betainstaller.sh && chmod 0700 betainstaller.sh && bash betainstaller.sh
    

    install with php 7.0.x latest
    Code (Text):
    yum -y update; curl -O https://centminmod.com/betainstaller7.sh && chmod 0700 betainstaller7.sh && bash betainstaller7.sh
    


    123.09beta01 change log at Change Log - CentminMod.com LEMP Nginx web stack for CentOS
     
  9. eva2000

    eva2000 Administrator Staff Member

    29,053
    6,594
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,790
    Local Time:
    4:55 PM
    Nginx 1.13.x
    MariaDB 5.5
    fyi, i updated both 123.08stable and 123.09beta01 and raised the low memory threshold for php fileinfo extension's memory check from 530000 bytes to 780000 bytes so you should be able to install properly now either version as any detected system installed memory below 780000 bytes will auto disable fileinfo extension in php

    commits at
    Thanks for reporting this issue. You just made centmin mod better :D

    edit: hmm i believe you enabled fileinfo option PHPFINFO='y' in centmin mod as php composer needs it though right ?

    what's output of command
    Code (Text):
    free -m
     
    Last edited: Jul 7, 2016
  10. chorong91

    chorong91 New Member

    16
    2
    3
    Dec 1, 2015
    Ratings:
    +2
    Local Time:
    4:55 PM
    yeah I set PHPFINFO=y
    123.08stable is updated?
    so I just reinstall it now?
    btw if I reinstall it should I just rebuild my VPS or there's a way to reinstall centmin?

    free -m output now:
    total used free shared buffers cached
    Mem: 490 318 171 0 71 79
    -/+ buffers/cache: 168 322
    Swap: 0 0 0
     
  11. eva2000

    eva2000 Administrator Staff Member

    29,053
    6,594
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,790
    Local Time:
    4:55 PM
    Nginx 1.13.x
    MariaDB 5.5
    You need to reinstall fresh clean CentOS OS first

    Right now PHPFINFO=y gets overrident to =n to disable if system memory is below 780000 bytes threshold ~761MB. So that wouldn't help if you need PHP to install fileinfo php extension for PHP composer usage. But Centmin Mod 123.08stable and 123.09beta01 will cleanly install with the update i made.

    So if you need fileinfo php extension for PHP composer, you need a VPS with more than 761MB of memory installed due to higher fileinfo php compilation memory requirements.

    So probably if $$$ budget is a concern maybe probably better to get a Linode $10/month VPS which has 2GB memory due to free memory upgrades Linode - Linode’s 13th Birthday – Gifts for All! | Centmin Mod Community

    DO vs Linode vs Vultr benchmarks too Virtual Private Server (VPS) hosting | Centmin Mod Community
     
  12. chorong91

    chorong91 New Member

    16
    2
    3
    Dec 1, 2015
    Ratings:
    +2
    Local Time:
    4:55 PM

    I still don't get it.
    So it's mean I can't install Centmin with 512MB Memory ?
    Centmin can't use DO $5 with 512MB right?
    it's that you mean?
     
  13. eva2000

    eva2000 Administrator Staff Member

    29,053
    6,594
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,790
    Local Time:
    4:55 PM
    Nginx 1.13.x
    MariaDB 5.5
    Centmin mod installs fine i have it running on 128-256MB VPS (128MB with variable tweak) but centos 6 32bit OS for that and php fileinfo disabled.
    Ah i see why you do not have a swap file set so that limits total memory availability with disk swap being a memory buffer

    so do the following if you need php fileinfo extension on 512mb vps

    1. fresh centos 6.x latest 64bit if you plan to upgrade the vps later to higher memory plans. If you do not ever plan to do a in-place same vps upgrade vps plans for more memory you can use centos 6.x 32bit as it has lower memory requirements than 64bit
    2. create swap file - 2GB swap file via single command below
    Code (Text):
    echo "create 2GB swap file"; dd if=/dev/zero of=/swapfile bs=1024 count=2048k; ls -lah /swapfile; mkswap /swapfile; swapon /swapfile; chown root:root /swapfile; chmod 0600 /swapfile; swapon -s; echo "/swapfile swap swap defaults 0 0" >> /etc/fstab; mount -a;

    3. confirm via free -m command swap file is created
    4. then install centmin mod
     
  14. eva2000

    eva2000 Administrator Staff Member

    29,053
    6,594
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,790
    Local Time:
    4:55 PM
    Nginx 1.13.x
    MariaDB 5.5
    Last edited: Jul 7, 2016
  15. eva2000

    eva2000 Administrator Staff Member

    29,053
    6,594
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,790
    Local Time:
    4:55 PM
    Nginx 1.13.x
    MariaDB 5.5
  16. eva2000

    eva2000 Administrator Staff Member

    29,053
    6,594
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,790
    Local Time:
    4:55 PM
    Nginx 1.13.x
    MariaDB 5.5
  17. chorong91

    chorong91 New Member

    16
    2
    3
    Dec 1, 2015
    Ratings:
    +2
    Local Time:
    4:55 PM
    • Like Like x 1
  18. eva2000

    eva2000 Administrator Staff Member

    29,053
    6,594
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,790
    Local Time:
    4:55 PM
    Nginx 1.13.x
    MariaDB 5.5