Use CPLSetConfigOption. See the [Config Options][1] docs. [1]: http://trac.osgeo.org/gdal/wiki/ConfigOptions