The problem can be solved but not in the traditional way. You have to use the php-gettext extension instead of the gettext which comes default built into php wampserver.

Follow these steps :

1) Download php-gettext from here: and unzip it …

2) Add the following files found in the package root in the same folder as test-language.php :
- gettext.php
- streams.php

gettext wampserver display

3) Open your php.ini and comment out wampserver php_gettext.dll:


RESTART All services

3) This is the new test file test-language.php

error_reporting(E_ALL | E_STRICT);

// define constants
define('PROJECT_DIR', realpath('./'));
define('LOCALE_DIR', 'C:/wamp/www/test/languages');
define('DEFAULT_LOCALE', 'es_ES');


$supported_locales = array('en_US', 'sr_CS', 'de_CH','es_ES');
$encoding = 'UTF-8';

$locale = (isset($_GET['lang']))? $_GET['lang'] : DEFAULT_LOCALE;


// gettext setup
T_setlocale(LC_MESSAGES, $locale);
// Set the text domain as 'messages'
$domain = 'messages';
bindtextdomain($domain, LOCALE_DIR);
// bind_textdomain_codeset is supported only in PHP 4.2.0+
if (function_exists('bind_textdomain_codeset'))
bind_textdomain_codeset($domain, $encoding);

echo gettext("HELLO_WORLD");

Now you can visit http://localhost/test/languages/test-language.php and you should see Hola