PHP ODBC Connect Cloudera Impala and Hive


CentOS 5.5
PHP 5.3.10
(This article also works for PHP 5.3.3 on CentOS 6).



UnixODBC can be installed from yum repo

I built a unixODBC 2.3.2 from source, installed to /usr/local/unixODBC

ODBC Connectors

Cloudera offers ODBC libs for both Hive and Impala:

Follow the install guide on urls above, only wget and yum –nogpgcheck localinstall xxx.rpm required.
Continue reading “PHP ODBC Connect Cloudera Impala and Hive” »

PHP ODBC Connect Cloudera Impala and Hive by @sskaje:

Incoming search terms:

Build Old PHP-ODBC from Source

CentOS 5.5 + PHP 5.3.10, I’ve built the latest unixODBC 2.3.2 from source to /usr/local/unixODBC.

I need to add php-odbc to my php’s extension list, as what I did, phpize && configure && make, but error occurred:

I tried to add ‘–with-adabas=no‘, but failed.

The solution is, DELETE all configs like

and leave the

block in config.m4.

Then phpize, configure, make.

For pdo_odbc, configure may like

Build Old PHP-ODBC from Source by @sskaje:

Incoming search terms:

Image Thumbnail Proxy

A friend of mine asked me how to check if a file exists remotely (http 404) so that he can create thumbnail for images which don’t have a thumbnail of that size.

As what he planned to do, a visitor browse his page, his script will check all images ready for rendering have a suitable thumbnail.

Checking a HTTP 404 is quite easy, but it’s not wise checking on page’s loading, if there are n images to be checked, a single page visit would makes server requests n to 2*n times for checking/generating thumbnail. These requests are useless at most time.
Continue reading “Image Thumbnail Proxy” »

Image Thumbnail Proxy by @sskaje:

Make FTP Active Mode Passive

First thing I should say is about the FTP active/passive mode, or say PORT/PASV mode.
We can read the differences from wikipedia or Active FTP vs. Passive FTP, a Definitive Explanation.

The two mode indicates who initialise the data connection and the active/passive is used to describe server’s action.
Active mode: server create a connection to the port client gives.
Passive mode: server receive a connection from a client.
Continue reading “Make FTP Active Mode Passive” »

Make FTP Active Mode Passive by @sskaje:

Incoming search terms: