Join the community today
Become a Member

Can not enable PHP fileinfo

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by ThanhDat, Aug 22, 2018.

  1. ThanhDat

    ThanhDat New Member

    8
    0
    1
    Aug 21, 2018
    Ratings:
    +0
    Local Time:
    12:00 PM
    Nginx
    i don't know
    Please fill in any relevant information that applies to you:
    • CentOS Version:CentOS 7 64bit ?
    • Centmin Mod Version Installed: i.e. 123.08stable
    • Nginx Version Installed: ?
    • PHP Version Installed: v7.2.8
    • Persistent Config: Do you have any persistent config file options set in /etc/centminmod/custom_config.inc ? You can check via this command:

      cat /etc/centminmod/custom_config.in

      Post output in CODE tags.
    I do like that comment:
    PHP-FPM - How to enable php fileinfo?

    When it done;

    I active fileinfo in PHP.ini but when I restart "fpmrestart" and receive nofitication that.


     
  2. eva2000

    eva2000 Administrator Staff Member

    40,342
    8,931
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,755
    Local Time:
    3:00 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    It's because PHP 7.2 is only really supported in Centmin Mod 123.09beta01 while Centmin Mod 123.08stable only really got to PHP 7.0 ish for full support.

    You can switch to Centmin Mod 123.09beta01 branch from 123.08stable via centmin.sh menu option 23 submenu option 1 and exit centmin.sh and re-run centmin.sh submenu option 3 and opting to select 123.09beta01 branch as outlined in 1st post at Beta Branch - Centmin Mod .09 beta branch Testing under heading How to switch to 123.09beta01 branch ?

    Then exist centmin.sh, re-enter /usr/local/src/centminmod directory and run centmin.sh once to do all auto updates available. Then do updates for nginx, php-fpm, memcached via centmin.sh menu option 4, 5 and 10 etc. More details below.

    Upgrading Centmin Mod Code to Latest Version



    Getting Started Guide step 19 outlines also how to keep Centmin Mod code updated or how to switch version branches or you can run cmupdate command that was recently added.

    Centmin Mod LEMP stack's script code is constantly updated for improvements, bug fixes and security fixes so keeping the Centmin Mod code up to date is important. With Centmin Mod 1.2.3-eva2000.08) (123.08stable) and higher releases, a newly added centmin.sh menu option 23 allows much easier code updates and version branch switching via Git backed environment you can setup.

    For 123.08stable that means centmin.sh menu option 23 submenu option 2 (if you previously ran submenu option 1) first, then exit centmin.sh, re-enter /usr/local/src/centminmod and re-run centmin.sh menu.

    For 123.09beta01 and higher that means running SSH command = cmupdate and then re-enter /usr/local/src/centminmod and re-run centmin.sh menu.

    For full details read the following links:
    Upgrading Centmin Mod involves 2 parts.
    1. Upgrading the actual Centmin Mod code outlined at Upgrade Centmin Mod. This is heart of Centmin Mod where the code is the engine that runs centmin.sh shell based menu and all the automation you're accustomed to. You can easily update within a Centmin Mod version branch or switch version branches via centmin.sh menu option 23 outlined here.
    2. Upgrade software that Centmin Mod installed or manages. For this part following outline at How to upgrade Centmin Mod software installed on your server.
    So essentially, you can upgrade from one version branch to another i.e. 123.08stable to 123.09beta01 or higher in place, but not everything is upgraded as some things like server initial environment setup isn't changed i.e. how swap, tmp setup and allocation are created etc. The main parts from part 2 above are what in place upgrades do i.e. Nginx and PHP-FPM compilation and config/settings parameters and MariaDB version from 5.5 to 10.0.x. If you want the full environment changed including tmp and swap setup to 123.09beta01 etc configuration, then you would need a fresh OS install and fresh 123.09beta01 initial install. You can think of it like upgrading Windows 7 to Windows 8. An in place upgrade will upgrade code but won't change your computer environment from when you installed Windows 7 i.e. disk configuration and partition sizes won't change from when you initially installed Windows 7. Only way to change that would be fresh Windows 8 install.
     
    • Like Like x 1
  3. eva2000

    eva2000 Administrator Staff Member

    40,342
    8,931
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,755
    Local Time:
    3:00 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    FYI, if you have no data on 123.08stable install, then easiest is reload fresh CentOS 7 OS and install fresh 123.09beta01 from scratch via PHP 7.2 installer outlined at Beta Branch - Centmin Mod .09 beta branch Testing 1st post

    Install 123.09beta01 with default PHP 7.2 latest
    Code (Text):
    yum -y update; curl -O https://centminmod.com/betainstaller72.sh && chmod 0700 betainstaller72.sh && bash betainstaller72.sh
    
     
    • Like Like x 1
  4. ThanhDat

    ThanhDat New Member

    8
    0
    1
    Aug 21, 2018
    Ratings:
    +0
    Local Time:
    12:00 PM
    Nginx
    i don't know
    I try PHP version 7.0 and 7.1 but still not working fileinfo
     
  5. eva2000

    eva2000 Administrator Staff Member

    40,342
    8,931
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,755
    Local Time:
    3:00 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    How much memory on your server ? output for command
    Code (Text):
    free -m
    


    For 123.09beta01 and higher, you need at least 1023000 kilobytes of total swap space and 780000 kilobytes of memory to enable fileinfo php extension due to fileinfo's native high memory compilation requirements.

    Basically fileinfo php compile via source is memory intensive. Same problem whenever you source compile PHP on any system

    i.e.
    If you meet the swap disk and minimum memory requirements, set in persistent config file /etc/centminmod/custom_config.inc
    Code (Text):
    PHPFINFO=y
    

    then run centmin.sh menu option 5 to recompile your php version

    If still has issues, then need the php-fpm upgrade log

    Every centmin.sh menu option has a full server log created with time stamped file name at /root/centminlogs. You can check that specific error log for clues or copy and paste log contents and post to pastebin.com or gist.github.com for sharing.

    To troubleshoot, you need to check the the php upgrade logs 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 nginx_upgrade and php_upgrade logs. You can see full details at How to troubleshoot Centmin Mod initial install issues

    if you type this command it lists all logs in date ascending order so latest log at bottom
    Code (Text):
    ls -lArt /root/centminlogs

    so copy the entire contents of latest php_upgrade log to gist.github.com or pastebin.com

    you can use grep to filter the logs, i.e. look for nginx_upgrade or php in log name
    Code (Text):
    ls -lahrt /root/centminlogs/ | egrep 'nginx_upgrade|php_upgrade'
    

    Code (Text):
    ls -lahrt /root/centminlogs/ | egrep 'nginx_upgrade|php_upgrade'
    -rw-r--r--  1 root root  2.6M Oct  3 03:48 centminmod_1.2.3-eva2000.09.001_031016-034409_php_upgrade.log
    -rw-r--r--  1 root root  664K Oct 12 09:24 centminmod_1.2.3-eva2000.09.001_121016-092406_nginx_upgrade.log
    

    So the last php upgrade log was named centminmod_1.2.3-eva2000.09.001_031016-034409_php_upgrade.log and located at /root/centminlogs/centminmod_1.2.3-eva2000.09.001_031016-034409_php_upgrade.log
    then use cat command to output the contents of that log.

    clear your ssh window buffer/screen and type
    Code (Text):
    cat /root/centminlogs/centminmod_1.2.3-eva2000.09.001_031016-034409_php_upgrade.log

    then select and copy and paste output to pastebin.com or gist.github.com file to share. If your SSH client's scroll buffer isn't large enough using cat might not output the entire log file contents, so you may need to download the log and use local text editor to open and copy and paste.

    so only need content of a specific log, in this case most recent php_upgrade.log logs
     
    • Like Like x 1
  6. ThanhDat

    ThanhDat New Member

    8
    0
    1
    Aug 21, 2018
    Ratings:
    +0
    Local Time:
    12:00 PM
    Nginx
    i don't know
    total used free shared buff/cache available
    Mem: 970 246 138 49 586 440
    Swap: 511 4 507
     
  7. eva2000

    eva2000 Administrator Staff Member

    40,342
    8,931
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,755
    Local Time:
    3:00 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Yeah that's why, not enough swap disk space given
    Who's the web host and which plan you're on ?

    If you can increase swap space from 512MB to 1GB, should be able to do it.
     
    • Like Like x 1
  8. ThanhDat

    ThanhDat New Member

    8
    0
    1
    Aug 21, 2018
    Ratings:
    +0
    Local Time:
    12:00 PM
    Nginx
    i don't know
  9. eva2000

    eva2000 Administrator Staff Member

    40,342
    8,931
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,755
    Local Time:
    3:00 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Ah then very easy to fix, Linode allows you to create your own swap disks provided you have some unallocated disk space, so you can increase it to 1024-2048MB see Linode - Custom Linode Swap size? :)
     
    • Like Like x 1
  10. ThanhDat

    ThanhDat New Member

    8
    0
    1
    Aug 21, 2018
    Ratings:
    +0
    Local Time:
    12:00 PM
    Nginx
    i don't know
    Mem: 970 231 97 39 641 482
    Swap: 1023 0 1023

    What next I need to do, please!
     
    Last edited: Aug 22, 2018
  11. eva2000

    eva2000 Administrator Staff Member

    40,342
    8,931
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,755
    Local Time:
    3:00 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    with persistent config file set to PHPFINFO=y , just recompile PHP via centmin.sh menu option 5 and input php version = 7.0.31 latest in 7.0 branch PHP: Hypertext Preprocessor to be safe for 123.08stable. For PHP 7.1.21 or 7.2.9, you want to switch to Centmin Mod 123.09beta01 as per 2nd post instructions.
     
    Last edited: Aug 22, 2018
    • Like Like x 1
  12. ThanhDat

    ThanhDat New Member

    8
    0
    1
    Aug 21, 2018
    Ratings:
    +0
    Local Time:
    12:00 PM
    Nginx
    i don't know
    It's still erorr
     
  13. eva2000

    eva2000 Administrator Staff Member

    40,342
    8,931
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,755
    Local Time:
    3:00 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    php_fileinfo.dll is a windows extension and shouldn't be used on CentOS linux - you don't need to add extension=php_fileinfo.dll as Centmin Mod automatically adds extension to PHP-FPM so don't add anything in php.ini
     
  14. ThanhDat

    ThanhDat New Member

    8
    0
    1
    Aug 21, 2018
    Ratings:
    +0
    Local Time:
    12:00 PM
    Nginx
    i don't know
    But
    <?php phpinfo(); ?>
     
  15. eva2000

    eva2000 Administrator Staff Member

    40,342
    8,931
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,755
    Local Time:
    3:00 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Last edited: Aug 22, 2018
  16. eva2000

    eva2000 Administrator Staff Member

    40,342
    8,931
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,755
    Local Time:
    3:00 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
  17. Meirami

    Meirami Member

    128
    15
    18
    Dec 21, 2017
    Ratings:
    +41
    Local Time:
    8:00 AM
    20180822_213941.jpg
    Typos?
    It should be inc not ini.
    y without '
    Edit:
    (well, both 'y' and y may work... Saw both at the forum...)
     
    Last edited: Aug 23, 2018
    • Like Like x 1
  18. eva2000

    eva2000 Administrator Staff Member

    40,342
    8,931
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,755
    Local Time:
    3:00 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    ah yes, nice catch persistent config file is at /etc/centminmod/custom_config.inc
     
..