Configuration Overview

Configure your environment to locate the extension module and OCS installations.

Environment Variables

To successfully use the extension module, set Sybase environment variables in the environment in which you run the PHP executable. At a minimum, you must set the $SYBASE and $SYBASE_OCS environment variables. Set the LD_LIBRARY_PATH variable to point to the correct location under the $SYBASE/$SYBASE_OCS/lib directory. The extension module loads the DBCAPI library from this location.

Sample Script

A script is provided that creates a sample php.ini file, which allows PHP to locate the extension module from the directory in which it is installed. This script, generate_php_ini.sh, is located in $SYBASE/$SYBASE_OCS/config. You must correctly set $SYBASE and $SYBASE_OCS for the generate_php_ini.sh script to generate the correct php.ini file.

You can use the generated php.ini file to run the firstapp.php sample or any other test using the extension module. For a typical installation, a php.ini file already exists and the information from the generate_php_ini.sh script in the sample php.ini is copied into an existing php.ini file.

A system administrator can copy the extension module into a different extension specific directory and load the extension module from the directory by modifying the php.ini file, for example:

; Set the default extension directory.
extension_dir = "/usr/local/lib/php/extensions" 
;Load the Sybase ASE PHP driver: sybaseasephp extension="sybaseasephp.so"

Once the file is modified, you can copy the $SYBASE/$SYBASE_OCS/php/php536_64/lib/sybaseasephp.so or $SYBASE/$SYBASE_OCS/php/php536_64/devlib/sybaseasephp.so library to /usr/local/lib/php/extensions.

Extension Libraries

When executing php -m you should see the sybaseasephp extension listed among the extensions active in the PHP installation.

Note: You need not place all extension libraries of a particular PHP installation in the same directory.