Problema con la codificación por defecto

  • Buenos dias,


    Recientemente he actualizado la versión de php del servidor de 5.4 a 5.6


    Todo ha funcionado como la seda, salvo el tema de la codificación. Una de las webs alojadas está codificada en iso-8859-1


    Cuando miro los headers:


    Content-Typetext/html; charset=UTF-8



    He intentado casi de todo...Pero no sé como indicarle al servidor web que entregue la pagina como iso-8859-1



    He creado un .htaccess con el adddefaulchartset, he metido un php.ini en htdocs....y nada. Lo ultimo ha sido modificar las paginas php para indicar la codificaión:
    header ('Content-type: text/html; charset=iso-8859-1');
    Pero no debo de tocar la web, porque no es mia.....



    ¿Alguna sugerencia?

  • Hello,


    i-MSCP version?
    Httpd server implementation in use (ITK, PHP-FPM, Fcgid)?


    You must change default_charset configuration parameter in the php.ini file of your customer. But better is to override default charset for that site only by adding:


    PHP
    1. ini_set('default_charset', 'iso-8859-1');

    somewhere in you code. Generally, you must add that code part in a file which is always included.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Result of the following command?


    Code
    1. # cat /etc/imscp/php-fpm/phpfpm.data |grep PHP_FPM_POOLS_LEVEL

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • So please, try:


    Shell-Script
    1. nano /etc/php5/fpm/pool.d/<domain.tld>.conf

    where <domain.tld> must be replaced with the domain name for which you want the ISO-8859-1 charset.


    Then, at bottom, add the following line


    PHP
    1. php_value[default_charset] = "ISO-8859-1"

    Once done, save the file and restart the FPM instance:

    Shell-Script
    1. # service php5-fpm restart

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Sencillamente perfecto. Solo un apunte... era un "/" en lugar del "-".


    Shell-Script
    1. nano /etc/php5/fpm/pool.d/<domain.tld>.conf

    Muchisimas gracias Nuxwin

  • @erhenry


    Fixed. Thanks ;)

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206