Why is my column data truncated at 4096 bytes when using PHP?

If you build PHP yourself, you need to copy the PHP.ini-dist file from the PHP source tree to /usr/local/lib (refer to the PHP INSTALL file). PHP.ini contains the default setting for uodbc.defaultlrl (or odbc.defaultltl): 4096. This limits the amount of data you get from a single column to 4096 bytes. You can increase defaultlrl to get more data, or you can change your PHP to use odbc_longreadlen.