sudo apt-get install gettext
./configure --with-gettext
make
to compile PHP with the gettext support enabled. php -i | grep gettext
gettext()
function to retrieve a translated string from a message catalog: $translated = gettext("Hello, world!");
echo $translated;
im using windowsIn order to include GNU gettext support in your PHP build, you will need to follow these steps:
1. Install the gettext library on your system. This library provides the necessary tools for translating messages in your PHP application. The installation process will vary depending on your operating system, but on most Linux distributions, you can install gettext with the following command:
Code:sudo apt-get install gettext
2. Download the PHP source code from the official website. You can download the latest version of PHP from You do not have permission to view the full content of this post. Log in or register now..
3. Extract the source code to a directory of your choice.
4. Navigate to the directory containing the PHP source code and run the following command:
Code:./configure --with-gettext
This will configure PHP to include support for the gettext library.
5. Runmake
to compile PHP with the gettext support enabled.
6. Once PHP has been compiled, you can verify that gettext support is enabled by running the following command:
Code:php -i | grep gettext
This should display information about the gettext extension, including the version number and any configuration options.
7. You can now use gettext functions in your PHP application to translate messages. For example, you can use thegettext()
function to retrieve a translated string from a message catalog:
Code:$translated = gettext("Hello, world!"); echo $translated;
This will output the translated version of the string "Hello, world!" if it is available in the message catalog for the current language.
To include GNU gettext support in PHP on Windows, you will need to follow these steps:im using windows
libintl.dll
in the gettext installation directory to intl.dll
.intl.dll
file from the gettext installation directory to the ext
directory in the PHP installation directory.php.ini
file in the PHP installation directory using a text editor.;extension=php_gettext.dll
and remove the semicolon at the beginning of the line to uncomment it.extension=php_gettext.dll
.php.ini
file.gettext()
function to retrieve a translated string from a message catalog: $translated = gettext("Hello, world!");
echo $translated;
How to adjust the system PATH variable to include the bin directory of the gettext installation directory in order for gettext to work properlyTo include GNU gettext support in PHP on Windows, you will need to follow these steps:
1. Download the latest version of PHP for Windows from the official website at You do not have permission to view the full content of this post. Log in or register now..
2. Extract the downloaded ZIP file to a directory of your choice. We will call this directory the PHP installation directory.
3. Download the gettext binaries for Windows from the GNU gettext website at You do not have permission to view the full content of this post. Log in or register now.. You will need to download the 32-bit or 64-bit version depending on your system architecture.
4. Extract the downloaded ZIP file to a directory of your choice. We will call this directory the gettext installation directory.
5. Rename the file namedlibintl.dll
in the gettext installation directory tointl.dll
.
6. Copy theintl.dll
file from the gettext installation directory to theext
directory in the PHP installation directory.
7. Open thephp.ini
file in the PHP installation directory using a text editor.
8. Find the line that says;extension=php_gettext.dll
and remove the semicolon at the beginning of the line to uncomment it.
9. Change the line to sayextension=php_gettext.dll
.
10. Save and close thephp.ini
file.
11. Restart the web server or PHP-FPM service.
12. You can now use gettext functions in your PHP application to translate messages. For example, you can use thegettext()
function to retrieve a translated string from a message catalog:
Code:$translated = gettext("Hello, world!"); echo $translated;
This will output the translated version of the string "Hello, world!" if it is available in the message catalog for the current language.
Note that you may need to adjust the system PATH variable to include the bin directory of the gettext installation directory in order for gettext to work properly.
To adjust the system PATH variable to include the bin directory of the gettext installation directory, you need to follow these steps:How to adjust the system PATH variable to include the bin directory of the gettext installation directory in order for gettext to work properly
i cant find the libintl.dll. did you mean libintl-8.dll?To include GNU gettext support in PHP on Windows, you will need to follow these steps:
1. Download the latest version of PHP for Windows from the official website at You do not have permission to view the full content of this post. Log in or register now..
2. Extract the downloaded ZIP file to a directory of your choice. We will call this directory the PHP installation directory.
3. Download the gettext binaries for Windows from the GNU gettext website at You do not have permission to view the full content of this post. Log in or register now.. You will need to download the 32-bit or 64-bit version depending on your system architecture.
4. Extract the downloaded ZIP file to a directory of your choice. We will call this directory the gettext installation directory.
5. Rename the file namedlibintl.dll
in the gettext installation directory tointl.dll
.
6. Copy theintl.dll
file from the gettext installation directory to theext
directory in the PHP installation directory.
7. Open thephp.ini
file in the PHP installation directory using a text editor.
8. Find the line that says;extension=php_gettext.dll
and remove the semicolon at the beginning of the line to uncomment it.
9. Change the line to sayextension=php_gettext.dll
.
10. Save and close thephp.ini
file.
11. Restart the web server or PHP-FPM service.
12. You can now use gettext functions in your PHP application to translate messages. For example, you can use thegettext()
function to retrieve a translated string from a message catalog:
Code:$translated = gettext("Hello, world!"); echo $translated;
This will output the translated version of the string "Hello, world!" if it is available in the message catalog for the current language.
Note that you may need to adjust the system PATH variable to include the bin directory of the gettext installation directory in order for gettext to work properly.
Yes, that may be the case. The gettext library has undergone several changes over the years, and the specific naming conventions of the DLLs may vary depending on the version of the library you have installed.i cant find the libintl.dll. did you mean libintl-8.dll?
libintl.dll
, try renaming libintl-8.dll
to intl.dll
instead, and copy it to the ext
directory in your PHP installation directory as described in step 6 of the previous instructions.i am using wamp64 how to add gnu get text supportTo include GNU gettext support in PHP on Windows, you will need to follow these steps:
1. Download the latest version of PHP for Windows from the official website at You do not have permission to view the full content of this post. Log in or register now..
2. Extract the downloaded ZIP file to a directory of your choice. We will call this directory the PHP installation directory.
3. Download the gettext binaries for Windows from the GNU gettext website at You do not have permission to view the full content of this post. Log in or register now.. You will need to download the 32-bit or 64-bit version depending on your system architecture.
4. Extract the downloaded ZIP file to a directory of your choice. We will call this directory the gettext installation directory.
5. Rename the file namedlibintl.dll
in the gettext installation directory tointl.dll
.
6. Copy theintl.dll
file from the gettext installation directory to theext
directory in the PHP installation directory.
7. Open thephp.ini
file in the PHP installation directory using a text editor.
8. Find the line that says;extension=php_gettext.dll
and remove the semicolon at the beginning of the line to uncomment it.
9. Change the line to sayextension=php_gettext.dll
.
10. Save and close thephp.ini
file.
11. Restart the web server or PHP-FPM service.
12. You can now use gettext functions in your PHP application to translate messages. For example, you can use thegettext()
function to retrieve a translated string from a message catalog:
Code:$translated = gettext("Hello, world!"); echo $translated;
This will output the translated version of the string "Hello, world!" if it is available in the message catalog for the current language.
Note that you may need to adjust the system PATH variable to include the bin directory of the gettext installation directory in order for gettext to work properly.
To add GNU gettext support to WampServer, you will need to follow these steps:i am using wamp64 how to add gnu get text support
libintl.dll
in the gettext installation directory to intl.dll
.intl.dll
file from the gettext installation directory to the ext
directory in your PHP version directory.php.ini
file in a text editor.;extension=php_gettext.dll
extension=php_gettext.dll
php.ini
file.gettext()
function to retrieve a translated string from a message catalog: $translated = gettext("Hello, world!");
echo $translated;
i did all your instructions. Is there anything need to setup and configure to run gettext on windows using wamp64?To add GNU gettext support to WampServer, you will need to follow these steps:
1. Open your WampServer installation folder and navigate to the PHP version you are using. This is usually located at "wamp64\bin\php\phpX.Y.Z".
2. Download the gettext binaries for Windows from the GNU gettext website at You do not have permission to view the full content of this post. Log in or register now.. You will need to download the 32-bit or 64-bit version depending on your system architecture.
3. Extract the downloaded ZIP file to a directory of your choice. We will call this directory the gettext installation directory.
4. Rename the file namedlibintl.dll
in the gettext installation directory tointl.dll
.
5. Copy theintl.dll
file from the gettext installation directory to theext
directory in your PHP version directory.
6. Open thephp.ini
file in a text editor.
7. Search for the line that looks like this:;extension=php_gettext.dll
8. Remove the semicolon at the beginning of the line to uncomment it.
9. Change the line to read:extension=php_gettext.dll
10. Save and close thephp.ini
file.
11. Restart the WampServer services (Apache and PHP).
12. You can now use gettext functions in your PHP application to translate messages. For example, you can use thegettext()
function to retrieve a translated string from a message catalog:
Code:$translated = gettext("Hello, world!"); echo $translated;
This will output the translated version of the string "Hello, world!" if it is available in the message catalog for the current language.
Note that you may need to adjust the system PATH variable to include the bin directory of the gettext installation directory in order for gettext to work properly.
i did all your instructions. Is there anything need to setup and configure to run gettext on windows using wamp64?Yes, that may be the case. The gettext library has undergone several changes over the years, and the specific naming conventions of the DLLs may vary depending on the version of the library you have installed.
If you cannot find the file namedlibintl.dll
, try renaminglibintl-8.dll
tointl.dll
instead, and copy it to theext
directory in your PHP installation directory as described in step 6 of the previous instructions.
Alternatively, you can search for the appropriate DLL file in the gettext installation directory, which may have a different name depending on the library version and the installation options.
Once you have followed the steps to add GNU gettext support to WampServer and have installed the gettext binaries and copied the appropriate files, you should be able to use gettext in your PHP code without any additional configuration.i did all your instructions. Is there anything need to setup and configure to run gettext on windows using wamp64?
"--with-gettext[=DIR] where DIR is the gettext install directory" how to execute this in windowsOnce you have followed the steps to add GNU gettext support to WampServer and have installed the gettext binaries and copied the appropriate files, you should be able to use gettext in your PHP code without any additional configuration.
However, if you encounter any issues
The "--with-gettext[=DIR]" option is a configure option that is used when compiling PHP from source code, and it is not used in the installation of pre-compiled PHP binaries on Windows."--with-gettext[=DIR] where DIR is the gettext install directory" how to execute this in windows
C:\php-source> configure --with-gettext=C:\gettext