Activities

October 2014
M T W T F S S
« Sep   Nov »
 12345
6789101112
13141516171819
20212223242526
2728293031  

PHP – How do I enable IDN library support in Curl

While on migrating a server to AWS platform, DevOPs complaint me that they are been used a a graph which will shows a graph based on the Google analytics data was not working on the new server. Based on the earlier requirement given by them was enable “Openssl” support on curl in order to work.

This time I’m confused and request DevOps to provide me more detailed requirement of displaying Google analytics. They given me a report and found a difference is IDN library support was missing on New server. After Googling of few hours (my hunting) and trail and errors, I found that system IDN library was missing and that what curl is not displaying it on their library list.

Here you go,

Curl_without_idb

Solution

1. Download IDN package from “http://ftp.gnu.org/gnu/libidn/” and installed it.

[root@OR-Web01 installation]# wget http://ftp.gnu.org/gnu/libidn/libidn-1.29.tar.gz
[root@OR-Web01 installation]# tar -zxvf libidn-1.29.tar.gz
[root@OR-Web01 libidn-1.29]# ./configure
[root@OR-Web01 libidn-1.29]# make
[root@OR-Web01 libidn-1.29]# make install

2. Download curl package and compile with with IDN and openssl support.

[root@OR-Web01 installation]# get http://curl.haxx.se/download/curl-7.38.0.tar.gz
[root@OR-Web01 installation]# tar -zxvf  curl-7.38.0.tar.gz
[root@OR-Web01 installation]# cd curl-7.38.0
[root@OR-Web01 curl-7.38.0]# ./configure  --with-ssl --with-zlib --with-libidn
[root@OR-Web01 curl-7.38.0]#
 curl version:     7.38.0
  Host setup:       x86_64-unknown-linux-gnu
  Install prefix:   /usr/local
  Compiler:         gcc
  SSL support:      enabled (OpenSSL)
  SSH support:      no      (--with-libssh2)
  zlib support:     enabled
  GSS-API support:  no      (--with-gssapi)
  TLS-SRP support:  no      (--enable-tls-srp)
  resolver:         default (--enable-ares / --enable-threaded-resolver)
  ipv6 support:     enabled
  IDN support:      enabled
  Build libcurl:    Shared=yes, Static=yes
  Built-in manual:  enabled
  --libcurl option: enabled (--disable-libcurl-option)
  Verbose errors:   enabled (--disable-verbose)
  SSPI support:     no      (--enable-sspi)
  ca cert bundle:   /etc/pki/tls/certs/ca-bundle.crt
  ca cert path:     no
  LDAP support:     enabled (OpenLDAP)
  LDAPS support:    enabled
  RTSP support:     enabled
  RTMP support:     no      (--with-librtmp)
  metalink support: no      (--with-libmetalink)
  HTTP2 support:    disabled (--with-nghttp2)
  Protocols:        DICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS LDAP LDAPS P           OP3 POP3S RTSP SMTP SMTPS TELNET TFTP
[root@OR-Web01 curl-7.38.0]#

Pls note IDN support: enabled is showing in the configure output.

root@OR-Web01 curl-7.38.0]#make
root@OR-Web01 curl-7.38.0]# make install
[root@OR-Web01 curl-7.38.0]# curl -V
curl 7.38.0 (x86_64-unknown-linux-gnu) libcurl/7.38.0 OpenSSL/1.0.1i zlib/1.2.7 libidn/1.29
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: IDN IPv6 Largefile NTLM NTLM_WB SSL libz
[root@OR-Web01 curl-7.38.0]#
[root@OR-Web01 curl-7.38.0]# php -r  'phpinfo();' | grep "curl" | tail -n 3
cURL Information => libcurl/7.38.0 OpenSSL/1.0.1i zlib/1.2.7 libidn/1.29
PWD => /home/installation/curl-7.38.0
_SERVER["PWD"] => /home/installation/curl-7.38.0
[root@OR-Web01 curl-7.38.0]#

curl_IDN_enabled

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>