raw code

PHP IDNA Extension

Robert Eisele

Libidn has been ported to the PHP programming language. This page contain notes to work on this library. A complete documentation is pending.

Overview

This extension provides a PHP implementation of the Internationalized Domain Name Applications (IDNA) standard. The extension offers two new functions:

<?php

echo idna_toASCII('xärg.örg');
echo idna_toUnicode('xn--xrg-9ka.xn--rg-eka');

?>

Installation

Installing with `pecl` command-line utility

  1. Install libidn (apt-get install libidn11-dev)
  2. Execute command "pecl install idna"
  3. Make sure you have extension=idna.so in your php.ini

Installing from sources

  1. Install libidn (apt-get install libidn11-dev)
  2. Download idna source package
  3. Unpack idna source package
  4. Go to idna folder and type "phpize && ./configure && make && make install"
  5. Make sure you have extension=idna.so in your php.ini

Compiling IDNA into PHP

  1. Install libidn (apt-get install libidn11-dev)
  2. Download idna source package
  3. Unpack idna source package to $PHP_SOURCE_DIR/ext/idna
  4. In php source root directory run commands: "rm configure && ./buildconf --force"
  5. Configure PHP with command "./configure --with-idna"
  6. Run make && make install

Links