Join the community today
Become a Member

PHP-FPM How to enable php-intl?

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by bloop, Sep 20, 2015.

Tags:
  1. bloop

    bloop New Member

    12
    1
    3
    Jul 13, 2015
    Ratings:
    +1
    Local Time:
    4:03 PM
    I'm installing mediawiki and it needs intl PECL extension. How do I enable it?

    I ran #php -m but don't see intl in the list, I thought it is installed by default? I have Centmin Mod 1.2.3-eva2000.08.

    Please advise, thanks!

     
  2. eva2000

    eva2000 Administrator Staff Member

    54,891
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    4:03 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    it should be installed by default
    Code:
     php --ri intl
    
    intl
    
    Internationalization support => enabled
    version => 1.1.0
    ICU version => 4.2.1
    
    Directive => Local Value => Master Value
    intl.default_locale => no value => no value
    intl.error_level => 0 => 0
    Code:
    php -m
    [PHP Modules]
    bcmath
    bz2
    calendar
    Core
    ctype
    curl
    date
    dom
    enchant
    ereg
    exif
    filter
    ftp
    gd
    geoip
    gettext
    gmp
    hash
    iconv
    imap
    intl
    json
    libxml
    mbstring
    mcrypt
    mhash
    mongo
    mysql
    mysqli
    mysqlnd
    openssl
    pcntl
    pcre
    PDO
    pdo_mysql
    pdo_pgsql
    pdo_sqlite
    Phar
    posix
    pspell
    readline
    redis
    Reflection
    session
    shmop
    SimpleXML
    snmp
    soap
    sockets
    SPL
    sqlite3
    standard
    sysvmsg
    sysvsem
    sysvshm
    tidy
    tokenizer
    xml
    xmlreader
    xmlrpc
    xmlwriter
    Zend OPcache
    zip
    zlib
    
    [Zend Modules]
    Zend OPcache
    
    what type of server ? VPS ? Xen, KVM, OpenVZ ? dedicated ? centos 6 or 7 ?

    fresh install or upgrade of Centmin Mod ? if upgrade, try recompiling PHP via centmin.sh menu option 5
     
  3. bloop

    bloop New Member

    12
    1
    3
    Jul 13, 2015
    Ratings:
    +1
    Local Time:
    4:03 PM
    It's a dedicated server and was a fresh install. Should I still recompile again?

    Code:
    # cat /etc/*release*
    1.2.3-eva2000.08
    CentOS release 6.6 (Final)
    CentOS release 6.6 (Final)
    CentOS release 6.6 (Final)
    cpe:/o:centos:linux:6:GA
    Code:
    #  php --ri intl
    Extension 'intl' not present.
     
  4. eva2000

    eva2000 Administrator Staff Member

    54,891
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    4:03 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    To troubleshoot installation, you need to check the initial install log at /root/centminlogs. You can see full details at How to troubleshoot Centmin Mod initial install issues

    When you run centmin.sh menu option 5 to recompile PHP, a new /root/centminlogs/ located php upgrade log is created so you can check to see if there's errors etc. You can use pastebin.com or gist.github.com to post the logs contents

    to list logs by date descending order
    Code:
    ls -lAhrt /root/centminlogs
     
  5. bloop

    bloop New Member

    12
    1
    3
    Jul 13, 2015
    Ratings:
    +1
    Local Time:
    4:03 PM
    I just tried recompiling and intl didn't install.

    Here's the php upgrade log

    Thanks!
     
  6. eva2000

    eva2000 Administrator Staff Member

    54,891
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    4:03 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    well not sure why PHP Intl extension isn't installed but latest PHP version you should use is 5.6.13 not 5.6.11 and you also need to run centmin.sh menu option 15 to recompile the ImagicK php extension as i see
    Code:
    Starting php-fpm [20-Sep-2015 16:00:20] NOTICE: PHP message: PHP Warning:  Version warning: Imagick was compiled against Image Magick version 1681 but version 1682 is loaded. Imagick will run but may behave surprisingly in Unknown on line 0
    done
    and your php configure line is missing --enable-intl

    your php configure line
    mine has --enable-intl

    looks like you may have set in centmin.sh some PHP extensions to disabled =n as default is
    Code:
    PHPFINFO=n                   # Disable or Enable PHP File Info extension
    PHPPCNTL=y                    # Disable or Enable PHP Process Control extension
    PHPINTL=y                    # Disable or Enable PHP intl extension
    PHPRECODE=n                   # Disable or Enable PHP Recode extension
    PHPSNMP=y                     # Disable or Enable PHP SNMP extension
    you'll want to ensure you have latest centmin mod 123.08stable code at /usr/local/src/centminmod so you can follow the upgrade instructions at Upgrade Centmin Mod - CentminMod.com LEMP Nginx web stack for CentOS for .07 and older updates (minus step 3 no need to upgrade mariadb if you are already on mariadb 10) - that method will wipe out /usr/local/src/centminmod with a fresh updated code

    then manually change into /usr/local/src/centminmod and run centmin.sh menu option 5 and set php 5.6.13
     
    Last edited: Sep 21, 2015
  7. bloop

    bloop New Member

    12
    1
    3
    Jul 13, 2015
    Ratings:
    +1
    Local Time:
    4:03 PM
    Thanks for the help eva.

    I'm already using 1.2.3-eva2000.08 and it was a fresh install. I don't think I've made any changes to the php configure line (I don't know where to make that change) and I used "Method 3: One Liner Curl Bash Install" to install.

    I checked centmin.sh it looks like this
    Code:
    PHPDEBUGMODE=n  # --enable-debug PHP compile flag
    PHPFINFO=n  # Disable or Enable PHP File Info extension
    PHPPCNTL=y  # Disable or Enable PHP Process Control extension
    PHPINTL=y  # Disable or Enable PHP intl extension
    PHPRECODE=n  # Disable or Enable PHP Recode extension
    PHPSNMP=y  # Disable or Enable PHP SNMP extension
    
    Should I upgrade to 5.6.13 or would I need to add --enable-intl to my php configure line first? and where do I do this?
     
  8. eva2000

    eva2000 Administrator Staff Member

    54,891
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    4:03 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    it should already add that line when PHPINTL=y is set

    can you post the contents of your /usr/local/src/centminmod/inc/php_configure.inc file to pastebin.com or gist.github.com so can check it out
     
  9. eva2000

    eva2000 Administrator Staff Member

    54,891
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    4:03 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    but yes try upgrading to 5.6.13 and see
     
  10. eva2000

    eva2000 Administrator Staff Member

    54,891
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    4:03 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    can you also post output of this command

    Code:
    yum list libicu libicu-devel --disablerepo=rpmforge,epel
     
  11. bloop

    bloop New Member

    12
    1
    3
    Jul 13, 2015
    Ratings:
    +1
    Local Time:
    4:03 PM
    Code:
    # yum list libicu libicu-devel --disablerepo=rpmforge,epel
    Loaded plugins: fastestmirror, priorities, security
    Loading mirror speeds from cached hostfile
    * base: centos.mirror.constant.com
    * extras: centos.mirror.constant.com
    * updates: centos.mirror.constant.com
    base  | 3.7 kB  00:00
    elasticsearch-1.7  | 2.9 kB  00:00
    extras  | 3.4 kB  00:00
    mariadb  | 2.9 kB  00:00
    updates  | 3.4 kB  00:00
    Installed Packages
    libicu.x86_64  4.2.1-12.el6  @base
    libicu-devel.x86_64  4.2.1-12.el6  @base
    php_configure.inc
    php_configure.inc · GitHub

    error pops up when trying to upgrade with centminmod
    Code:
    Enter PHP Version number you want to upgrade/downgrade to: 5.6.13
    ----------------------------------------------------------------
    Want to update to latest php-fpm.conf ? (overwrites will auto backup existing php-fpm.conf)
    existing php.ini will be backed up at /usr/local/lib/php.ini-oldversion_220915-124409
    existing php-fpm.conf will be backed up at /usr/local/etc/php-fpm.conf-oldversion_220915-124409
    ----------------------------------------------------------------
    Update & overwrite your existing php-fpm.conf [y/n]: y
    ----------------------------------------------------------------
    PHP Warning:  Version warning: Imagick was compiled against Image Magick version 1681 but version 1682 is loaded. I  magick will run but may behave surprisingly in Unknown on line 0
    
    -----------------------------------------------------------------------------------------
    Detected PHP 5.6 branch.
    You can compile Zend OPcache (Zend Optimizer Plus+) support
    as an alternative to using APC Cache or Xcache cache.
    But Zend OPcache only provides PHP opcode cache and
    DOESN'T do data caching, so if you web apps such as Wordpress,
    Drupal or vBulletin require data caching to APC or Xcache,
    it won't work with Zend OPcache.
    
    -----------------------------------------------------------------------------------------
    Do you want to use Zend OPcache [y/n] ? y
    
    *************************************************
    * Zend Optimizer Plus OPcache installed
    *************************************************
    *************************************************
    * Upgrading PHP
    *************************************************
    2015-09-22 12:45:50 URL:http://php.net/distributions/php-5.6.13.tar.gz [18316403/18316403] -> "mirror" [1]
    tar (child): php-5.6.13.tar.gz: Cannot open: No such file or directory
    tar (child): Error is not recoverable: exiting now
    tar: Child returned status 2
    tar: Error is not recoverable: exiting now
    inc/php_upgrade.inc: line 256: cd: php-5.6.13: No such file or directory
    
    *************************************************
    * Updating php.ini...
    *************************************************
    old php.ini will be saved at /usr/local/lib/php.ini-oldversion_220915-124409
    if you have modified your old php.ini i.e. installed and loaded
    APC, Xcache, Memcache or Suhosin - please re-install them after php upgrade
    ...
    cp: cannot stat `php.ini-production': No such file or directory
    
    make: *** No rule to make target `clean'.  Stop.
    inc/php_upgrade.inc: line 299: ./buildconf: No such file or directory
    make: *** No rule to make target `clean'.  Stop.
    ../configure --enable-fpm --enable-opcache --with-mhash --with-zlib --with-gettext --enable-exif --enable-zip --wit  h-bz2 --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-shmop --with-pear  --enable-mbstring --with-openssl --with-mysql=mysqlnd --with-libdir=lib64 --with-mysqli=mysqlnd --with-mysql-sock=/  var/lib/mysql/mysql.sock --with-curl --with-gd --with-xmlrpc --enable-bcmath --enable-calendar --enable-ftp --enabl  e-gd-native-ttf --with-freetype-dir=/usr --with-jpeg-dir=/usr --with-png-dir=/usr --with-xpm-dir=/usr --with-vpx-di  r=/usr --with-t1lib=/usr --enable-pdo --with-pdo-sqlite --with-pdo-mysql=mysqlnd --enable-inline-optimization --wit  h-imap --with-imap-ssl --with-kerberos --with-readline --with-libedit --with-gmp --with-pspell --with-tidy --with-e  nchant --with-fpm-user=nginx --with-fpm-group=nginx --disable-fileinfo --with-config-file-scan-dir=/etc/centminmod/  php.d
    inc/php_configure.inc: line 220: ../configure: No such file or directory
    make: *** No targets specified and no makefile found.  Stop.
    
    real  0m0.001s
    user  0m0.000s
    sys  0m0.000s
    make: *** No rule to make target `install'.  Stop.
    
    real  0m0.001s
    user  0m0.000s
    sys  0m0.000s
    
    strip PHP binary...
    -rwxr-xr-x 1 root root 8.7M Sep 20 15:59 /usr/local/bin/php
    -rwxr-xr-x 1 root root 8.7M Sep 20 15:59 /usr/local/bin/php-cgi
    -rwxr-xr-x 1 root root 8.7M Sep 22 12:45 /usr/local/bin/php
    -rwxr-xr-x 1 root root 8.7M Sep 22 12:45 /usr/local/bin/php-cgi
    
    service php-fpm restart
    Gracefully shutting down php-fpm . done
    Starting php-fpm [22-Sep-2015 12:45:52] NOTICE: PHP message: PHP Warning:  Version warning: Imagick was compiled ag  ainst Image Magick version 1681 but version 1682 is loaded. Imagick will run but may behave surprisingly in Unknown  on line 0
     done
    *************************************************
    
    Tue Sep 22 12:45:51 EDT 2015
    Success: PHP configure ok
    
    *************************************************
    make -j9
    make: *** No targets specified and no makefile found.  Stop.
    
    real  0m0.001s
    user  0m0.000s
    sys  0m0.001s
    *************************************************
    
    Tue Sep 22 12:45:52 EDT 2015
    Error: 2, PHP make failed (1.2.3-eva2000.08)
    
    *************************************************
     
    Last edited: Sep 23, 2015
  12. eva2000

    eva2000 Administrator Staff Member

    54,891
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    4:03 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    your php_configure.inc doesn't match the latest centmin mod 1.2.3-eva2000.08 stable one at centminmod/centminmod at 123.08stable · GitHub so suggests you are not running latest for whatever reason

    run these commands to update to latest stable which was updated just moments ago for Nginx 1.9.5 + HTTP/2 support too

    Code:
    cd /usr/local/src
    rm -rf /usr/local/src/*
    git clone https://github.com/centminmod/centminmod.git centminmod
    cd centminmod
    git checkout -f 123.08stable
    
    Then run once to do any auto detected update tasks i.e. ccache gets updated if detected to not exist or be an older version.
    Code:
    cd /usr/local/src/centminmod
    ./centmin.sh
    then run menu option 5 to upgrade PHP
     
  13. eva2000

    eva2000 Administrator Staff Member

    54,891
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    4:03 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    php download probably failed to download fully so php-5.6.13.tar.gz doesn't exist

    clear the incomplete download in /svr-setup/php-5.6.13.tar.gz and try again
    Code:
    rm -rf /svr-setup/php-5.6.13*
     
  14. eva2000

    eva2000 Administrator Staff Member

    54,891
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    4:03 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    If you still have problems i suspect could be specific to VPS itself maybe incomplete downloads or network connectivity issues. You can probably confirm by spinning up an hourly cloud vps server DigitalOcean or Vultr. After testing just destroy that hourly cloud VPS instance.
     
  15. eva2000

    eva2000 Administrator Staff Member

    54,891
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    4:03 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    FYI, I just tested a fresh Centmin Mod 1.2.3-eva2000.08 install
    Code:
    curl -O https://centminmod.com/installer.sh && chmod 0700 installer.sh && bash installer.sh
    Code:
    ---------------------------------------------------------------------------
    Total Curl Installer YUM Time: 101.9987 seconds
    Total YUM Time: 66.990174903 seconds
    Total YUM + Source Download Time: 92.8176
    Total Nginx First Time Install Time: 132.9783
    Total PHP First Time Install Time: 126.9416
    Download Zip From Github Time: 4.2619
    Total Time Other eg. source compiles: 249.7396
    Total Centmin Mod Install Time: 602.4770
    ---------------------------------------------------------------------------
    Total Install Time (curl yum + cm install + zip download): 708.7376 seconds
    ---------------------------------------------------------------------------
    Code:
    php --ri intl
    
    intl
    
    Internationalization support => enabled
    version => 1.1.0
    ICU version => 4.2.1
    
    Directive => Local Value => Master Value
    intl.default_locale => no value => no value
    intl.error_level => 0 => 0
     
  16. bloop

    bloop New Member

    12
    1
    3
    Jul 13, 2015
    Ratings:
    +1
    Local Time:
    4:03 PM
    Just to be safe, I wanted to confirm that it would be ok to do this on a live server it's currently running a xenforo forum. Thanks..
     
  17. eva2000

    eva2000 Administrator Staff Member

    54,891
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    4:03 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+

    Upgrading Centmin Mod Code to Latest Version



    Upgrading Centmin Mod involves 2 parts.
    1. Upgrading the actual Centmin Mod code outlined at Upgrade Centmin Mod - CentminMod.com LEMP Nginx web stack for CentOS 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.
    2. Upgrade software that Centmin Mod installed or manages. For this part following outline at Upgrade - How to upgrade Centmin Mod | Centmin Mod Community
    So Centmin Mod code is passive, it only runs when you invoke centmin.sh menu options otherwise there is no direct affect on a live operating site unless you are running centmin.sh menu option i.e. menu option 4 to upgrade Nginx or menu option 5 to upgrade PHP
     
  18. bloop

    bloop New Member

    12
    1
    3
    Jul 13, 2015
    Ratings:
    +1
    Local Time:
    4:03 PM
    Followed the instructions removed centmin/redownload, upgraded php and fixed imagemagick as instructed but still no intl for some reason..
    Code:
    # php --ri intl
    Extension 'intl' not present.
    
    php_upgrade.log · GitHub

    php_configure.inc · GitHub

    Any other suggestions? I'm using this dedicated server so testing on a VPS won't really help the problem. Thanks. :)
     
  19. eva2000

    eva2000 Administrator Staff Member

    54,891
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    4:03 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Then I am at a loss as to why, as I have 80+ servers all have PHP Intl installed and loaded !

    Only thing i can think of is if you have setup a persistent config file outlined at Upgrade Centmin Mod - CentminMod.com LEMP Nginx web stack for CentOS and had added to the file /etc/centminmod/custom_config.inc
    Code:
    PHPFINFO=n  # Disable or Enable PHP File Info extension
    PHPPCNTL=n  # Disable or Enable PHP Process Control extension
    PHPINTL=n  # Disable or Enable PHP intl extension
    PHPRECODE=n  # Disable or Enable PHP Recode extension
    PHPSNMP=n  # Disable or Enable PHP SNMP extension
    this would override what is set in centmin.sh
    Why i suggest that is your clearly have PHP Intl and even pcntl and php snmp extensions disabled on your compile options.

    your latest log file's configure options