¿Estas atascado? ¡Yo te ayudo!, pregunta aquí.

Problemas con caracteres, configurar apache, php.ini y mysql en UTF8

Todo sobre linux, programas para linux, configuraciones de sistema linux, etc..

Notapor alexiter » Jue Nov 10, 2016 6:58 pm

Switching to UTF-8 in MySQL

For starters, open up your my.cnf file, generally located in /etc/my.cnf or /etc/mysql/my.cnf, and add the following lines to the appropriate sections:

Código: Seleccionar todo
[client]
loose-default-character-set = utf8

[mysql]
loose-default-character-set = utf8

[mysqld]
collation-server = utf8_unicode_ci
loose-default-character-set = utf8
character-set-server = utf8
init-connect = 'SET NAMES utf8'
skip-character-set-client-handshake


Switching to UTF-8 in PHP

Open up your php.ini file, generally located in /etc/php.ini, /etc/php5/php.ini, or /etc/php5/apache2/php.ini, and add or replace the following line:

Código: Seleccionar todo
default_charset = "UTF-8"


Switching to UTF-8 in Apache

If you use the Apache web server, you’ll also want to set UTF-8 as the default charset there as well. Generally speaking, you want to add the following tag to your httpd.conf value, but sometimes the config option is already set in an include file such as /etc/apache2/conf-available/charset.

Código: Seleccionar todo
AddDefaultCharset UTF-8
alexiter
Site Admin
 
Mensajes: 157
Registrado: Dom Nov 17, 2013 9:54 pm

Volver a Linux

cron
  • Buscar mensajes nuevos
  • Buscar temas sin respuesta
  • ¿Quién está conectado?
  • Hay 19 Usuarios identificados :: 0 registrado, 0 ocultos y 19 invitados (basados en usuarios activos en los últimos 5 minutos)
  • La mayor cantidad de usuarios identificados fue 619 el Dom May 03, 2020 11:11 pm
  • Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 19 invitados