I want migrate old website (php 5.6) from Debian 8.10 to Ubuntu 16.04.3 server.
The apache configuration have been exported in the new server and mysql database is hosted on another server : no change.
After migration, the accents characters from database are displayed as is : 'é'. The problem appear only for data get in database.
These characters are displayed also as is in database, but on the old website, it's correctly displayed in web browser.
Database is mariaDB 10.0.31 and the collation : latin1.
I can't touch the database and php code.
PHP / apache configurations are the same. Juste the hosted system is different. Why the characters are interpreted differently ?
I tried in vhost configuration these options : CharsetDefault UTF-8 AddDefaultCharset UTF-8 AddCharset UTF-8 .utf8
I also tried change locale : en_US.UTF-8 fr_FR.UTF-8
But no change effect...
Any idea ?
Thank you for your help !
Old configuration : PHP 5.6.30-0+deb8u1 Apache/2.4.10 Debian 8.10
New configuration : PHP 5.6.32-1+ubuntu16.04.1+deb.sury.org+2 Apache/2.4.18 Ubuntu 16.04.3
Virtual host :
<VirtualHost *:80>
ServerAdmin webmaster@HIDDEN.fr
DocumentRoot /var/www-HIDDEN
ServerName yyy.HIDDEN.fr
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
<Directory /var/HIDDEN/>
AllowOverride All
Options Indexes FollowSymLinks
Require all granted
Order allow,deny
allow from all
</Directory>
<IfModule mod_php5.c>
AddType application/x-httpd-php .php
php_flag magic_quotes_gpc Off
php_flag track_vars On
php_flag register_globals Off
php_value include_path .
</IfModule>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Locale on the new server :
root@ubuntu16:~# locale
LANG=fr_FR.UTF-8
LANGUAGE=
LC_CTYPE="fr_FR.UTF-8"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_COLLATE="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_MESSAGES="fr_FR.UTF-8"
LC_PAPER="fr_FR.UTF-8"
LC_NAME="fr_FR.UTF-8"
LC_ADDRESS="fr_FR.UTF-8"
LC_TELEPHONE="fr_FR.UTF-8"
LC_MEASUREMENT="fr_FR.UTF-8"
LC_IDENTIFICATION="fr_FR.UTF-8"
LC_ALL=
Locale on the old server :
root@debian8:~# locale
LANG=fr_FR.UTF-8
LANGUAGE=
LC_CTYPE="fr_FR.UTF-8"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_COLLATE="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_MESSAGES="fr_FR.UTF-8"
LC_PAPER="fr_FR.UTF-8"
LC_NAME="fr_FR.UTF-8"
LC_ADDRESS="fr_FR.UTF-8"
LC_TELEPHONE="fr_FR.UTF-8"
LC_MEASUREMENT="fr_FR.UTF-8"
LC_IDENTIFICATION="fr_FR.UTF-8"
LC_ALL=
But, same probleme with this value : en_US.UTF-8