[ CentOS 7.3.1611 CORE ] Missing non-ascii characters

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
SnowStorm
Posts: 2
Joined: Thu Jan 05, 2017 5:23 pm

[ CentOS 7.3.1611 CORE ] Missing non-ascii characters

Post by SnowStorm »

Hello,

I have a problem that is driving me crazy. When I try submit from form any special non-ascii character for example "°" ( degree symbol ) - php drop this after done submit.

Example:

Let's fill --title graph through Cacti website. Title should be "Temperature in °C" - but RRD get only "Temperature in C" string. When I do that from shell by rrd graph command from example rrd file everything is ok like on image.

Image

MORE:

Whole the Cacti website encoding working perfect! Template names etc are ok, got utf8 encoding. Only strings from forms are broken down.

I'm open to suggestions to help solve my problem.

EDIT:

PHP Mbstring section:

  • Directive => Local Value => Master Value
    mbstring.detect_order => UTF-8,CP1251,KOI8-R => UTF-8,CP1251,KOI8-R
    mbstring.encoding_translation => On => On
    mbstring.func_overload => 0 => 0
    mbstring.http_input => UTF-8,CP1251,KOI8-R => UTF-8,CP1251,KOI8-R
    mbstring.http_output => UTF-8 => UTF-8
    mbstring.http_output_conv_mimetypes => ^(text/|application/xhtml\+xml) => ^(text/|application/xhtml\+xml)
    mbstring.internal_encoding => UTF-8 => UTF-8
    mbstring.language => Neutral => Neutral
    mbstring.strict_detection => On => On
    mbstring.substitute_character => no value => no value

PHP version : PHP Version => 5.4.16


PHP GD Lib Section:
  • gd

    GD Support => enabled
    GD Version => bundled (2.1.0 compatible)
    FreeType Support => enabled
    FreeType Linkage => with freetype
    FreeType Version => 2.4.11
    T1Lib Support => enabled
    GIF Read Support => enabled
    GIF Create Support => enabled
    JPEG Support => enabled
    libJPEG Version => 6b
    PNG Support => enabled
    libPNG Version => 1.5.13
    WBMP Support => enabled
    XPM Support => enabled
    libXpm Version => 30411
    XBM Support => enabled

    Directive => Local Value => Master Value
    gd.jpeg_ignore_warning => 0 => 0

    gettext

    GetText Support => enabled
And for the end, my PHP \*
  • php.x86_64 5.4.16-42.el7
    php-bcmath.x86_64 5.4.16-42.el7
    php-cli.x86_64 5.4.16-42.el7
    php-common.x86_64 5.4.16-42.el7
    php-devel.x86_64 5.4.16-42.el7
    php-gd.x86_64 5.4.16-42.el7
    php-intl.x86_64 5.4.16-42.el7
    php-ldap.x86_64 5.4.16-42.el7
    php-mbstring.x86_64 5.4.16-42.el7
    php-mcrypt.x86_64 5.4.16-7.el7
    php-mysql.x86_64 5.4.16-42.el7
    php-paragonie-random-compat.noarch 1.4.1-1.el7
    php-password-compat.noarch 1.0.4-1.el7
    php-pdo.x86_64 5.4.16-42.el7
    php-pear.noarch 1:1.9.4-21.el7
    php-pecl-igbinary.x86_64 1.2.1-1.el7
    php-pecl-redis.x86_64 2.2.8-1.el7
    php-php-gettext.noarch 1.0.12-1.el7
    php-process.x86_64 5.4.16-42.el7
    php-snmp.x86_64 5.4.16-42.el7
    php-symfony-class-loader.noarch 2.8.12-2.el7
    php-symfony-common.noarch 2.8.12-2.el7
    php-symfony-intl.noarch 2.8.12-2.el7
    php-symfony-locale.noarch 2.8.12-2.el7
    php-symfony-polyfill.noarch 1.2.0-1.el7
    php-tcpdf.noarch 6.2.11-1.el7
    php-tcpdf-dejavu-sans-fonts.noarch 6.2.11-1.el7
    php-tidy.x86_64 5.4.16-7.el7
    php-xml.x86_64 5.4.16-42.el7
    phpMyAdmin.noarch 4.4.15.9-1.el7
EDIT #2:

Fresh install on Centos 6.8 with downgraded versions of libs - no effect. So... Cacti can't POST a special characters ... ? I have no idea. I'm not a PHP dev.

Regards,
SnowStorm
Posts: 2
Joined: Thu Jan 05, 2017 5:23 pm

Re: [ CentOS 7.3.1611 CORE ] Missing non-ascii characters

Post by SnowStorm »

Finally I found solution:

It was as stupid as easy to do:

RHEL/Centos systems need to change default apache LANG variable at Apache 2.4.x:

"[root@localhost ~]# cat /etc/sysconfig/httpd

Here is :

#
# This file can be used to set additional environment variables for
# the httpd process, or pass additional options to the httpd
# executable.
#
# Note: With previous versions of httpd, the MPM could be changed by
# editing an "HTTPD" variable here. With the current version, that
# variable is now ignored. The MPM is a loadable module, and the
# choice of MPM can be changed by editing the configuration file
# /etc/httpd/conf.modules.d/00-mpm.conf.
#

#
# To pass additional options (for instance, -D definitions) to the
# httpd binary at startup, set OPTIONS here.
#
#OPTIONS=

#
# This setting ensures the httpd process is started in the "C" locale
# by default. (Some modules will not behave correctly if
# case-sensitive string comparisons are performed in a different
# locale.)
#
LANG=C

-------------------------------------------------------------------------------------

Now replace "LANG=C to:

LANG=en_US.UTF-8
# or Your native language. That's all.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests