The behavior of the SQL Anywhere PHP driver can be controlled by setting values in the PHP initialization file, php.ini. The following entries are supported:
extension Causes PHP to load the SQL Anywhere PHP module automatically each time PHP starts. Adding this entry to your PHP initialization file is optional, but if you don't add it, each script you write must start with a few lines of code that ensure that this module is loaded. The following entry is used for Windows platforms.
extension=phpX_sqlanywhere10.dllOn Linux platforms, use one of the following entries. The second entry uses threads.
extension=phpX_sqlanywhere10.so extension=phpX_sqlanywhere10_r.soIn these entries, X identifies the PHP version. You can use version 4 or version 5. If the SQL Anywhere module is not always automatically loaded when PHP starts, you must prefix each script you write with the following lines of code. This code ensures that the SQL Anywhere PHP module is loaded.
# Ensure that the SQL Anywhere PHP module is loaded if( !extension_loaded('sqlanywhere') ) { # Find out which version of PHP is running $version=phpversion; if( strtoupper(substr(PHP_OS, 0, 3) == 'WIN') ) { dl( $module_name.'.dll' ); } else { dl( $module_name.'.so' ); } }
allow_persistent Allows persistent connections when set to 1. It does not allow them when set to 0. The default value is 1.
sqlanywhere.allow_persistent=1
max_persistent Sets the maximum number of persistent connections. The default value is -1, which means no limit.
sqlanywhere.max_persistent=-1
max_connections Sets the maximum number of connections that can be opened at once through the SQL Anywhere PHP module. The default value is -1, which means no limit.
sqlanywhere.max_connections=-1
auto_commit Specifies whether the database server performs a commit operation automatically. The commit is performed immediately following the execution of each statement when set to 1. When set to 0, transactions should be ended manually with either the sqlanywhere_commit or sqlanywhere_rollback functions, as appropriate. The default value is 1.
sqlanywhere.auto_commit=1
row_counts Returns the exact number of rows affected by an operation when set to 1 or an estimate when set to 0. The default value is 0.
sqlanywhere.row_counts=0
verbose_errors Returns verbose errors when set to 1. Otherwise, you must call the sqlanywhere_error or sqlanywhere_errorcode functions to get further error information. The default value is 1.
sqlanywhere.verbose_errors=1
For more information, see sqlanywhere_set_option.