You can place your odbc.ini file in the current users home directory or in the file pointed to by the ODBCINI environment variable. You can also put your DSNs in /etc/odbc.ini. You can also place the sensitive information in the call to SQLDriverConnect by setting the attributes in the in_connection_string parameter.
e.g. SQLDriverConnect(dbc,
"DSN=dsn_name;LOGONUSER=username;LOGONAUTH=password;",
...);
Attributes set in the in_connection_string argument to SQLDriverConnect override values in the odbc.ini file.
To set the ODBCINI environment variable from PHP use:
putenv ("<path>/odbc.ini");
To see what environment variables are set to from PHP use:
phpinfo();
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.