Topic: php56 utf8_encode and utf8_decode


I have installed php 5.6 from Remi's repository with this yum command:

yum install -y php56-php php56-php-bcmath php56-php-cli php56-php-common php56-php-dba php56-php-devel php56-php-enchant php56-php-fpm php56-php-gd php56-php-gmp php56-php-imap php56-php-interbase php56-php-intl php56-php-ioncube-loader php56-php-ldap php56-php-litespeed php56-php-lz4 php56-php-magickwand* php56-php-mbstring php56-php-mcrypt php56-php-mysqlnd php56-php-odbc php56-php-opcache php56-php-pdo php56-php-pear php56-php-pecl-env php56-php-pecl-geoip php56-php-pecl-gnupg php56-php-pecl-igbinary php56-php-pecl-igbinary-devel php56-php-pecl-imagick php56-php-pecl-imagick-devel php56-php-pecl-inotify php56-php-pecl-json* php56-php-pecl-lzf php56-php-pecl-mailparse php56-php-pecl-memcache php56-php-pecl-memcached php56-php-pecl-msgpack php56-php-pecl-msgpack-devel php56-php-pecl-mysqlnd* php56-php-mysqlnd* php56-php-pecl-newt php56-php-pecl-redis php56-php-pecl-scrypt php56-php-pecl-sqlite* php56-php-sqlite* php56-php-pecl-uploadprogress php56-php-pecl-xmldiff php56-php-pecl-xmldiff-devel php56-php-pecl-yaml php56-php-pecl-zip php56-php-phpiredis* php56-php-process php56-php-pspell php56-php-snmp php56-php-soap php56-php-tidy php56-php-xml php56-php-xmlrpc php56-runtime

But, the functions utf8_encode and utf8_decode seems to be missing, I need this functions, any idea? I have read that this functions are on the xml package but it is already installed, I don't know what can be happening...

Lot of thanks.

Re: php56 utf8_encode and utf8_decode

Until PHP 7.1 theses function are part of the xml extension

$ scl enable php56 'php --re xml' | grep utf8_
    Function [ <internal:xml> function utf8_encode ] {
    Function [ <internal:xml> function utf8_decode ] {

Since PHP 7.2 they are part of the standard extension

$ scl enable php72 'php --re standard' | grep utf8_
    Function [ <internal:standard> function utf8_encode ] {
    Function [ <internal:standard> function utf8_decode ] {

As you have installed the SCL version (designed for parallel installation of multiple versions), ensure you are using the right version

$ scl enable php56 'php -i' | grep ini
Configuration File (php.ini) Path => /etc/opt/remi/php56
Loaded Configuration File => /etc/opt/remi/php56/php.ini
Scan this dir for additional .ini files => /etc/opt/remi/php56/php.d
Additional .ini files parsed => /etc/opt/remi/php56/php.d/15-xdebug.ini,
Desktop: Fedora 29 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 28 x86_64 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 6.10 x86_64 with EPEL, remi, remi-php72 and remi-php72-test