$e->getMessage(); outputs in French

How do I get the error messages of $e->getMessage(); to output in English?

My full php page:

	$pdo = new PDO('mysql:host=localhost;dbname=ijdb', 'ijdbuser', 'password');
	$pdo->exec('SET NAMES "utf8"');
catch (PDOException $e) // store the exception in $e
	$output = 'There is a problem with the page: ' . $e->getMessage();
	include 'output.html.php';
$output = 'Database connection established.'; 
include 'output.html.php';

Error message reads:
There is a problem with the page: SQLSTATE[HY000] [1045] Acc�s refus� pour l’utilisateur: ‘ijdbuser’@‘@localhost’ (mot de passe: OUI)

surely this is a server setting isn’t it? Try asking your host provider, can’t see another reason for it to output in french unless the server/mysql is set to output french.

c’est la vie

This is a WAMP stack on my Windows 7 machine in America. I would expect the default setting to be in English. I’ve had WAMP in the past (on a previous computer), and it was always in English. Reinstalled as a fresh download in this newer computer, it is in French. I could not find a setting for this in php.ini or my.ini.

You probably downloaded the french version


setlocale(LC_ALL, 'en_US.utf8');

at the very start of your script.

or if that doesn’t work

setlocale(LC_ALL, 'en_US');

or possibly ‘en_GB.utf8’ or ‘en_GB’ if that also doesn’t work.

Everything else in WAMP is in English.

I tried both of those and it remained in French. Specifically, I inserted it after the first <?php:

<?php setlocale(LC_ALL, “en_US.UTF-8”);

I got it from here, so that’s not the problem: