Install the external environment module to support PHP in the database.
A copy of PHP must be installed on the database server computer and SQL Anywhere database server must be able to locate the PHP executable.
The SQL Anywhere PHP driver (shipped with SQL Anywhere) must be installed on the database server computer and PHP must be configured to use it. See PHP client deployment.
Context and remarks
In addition to the above two prerequisites, the database administrator must also install the SQL Anywhere PHP External Environment module. Prebuilt modules for several versions of PHP are included with the SQL Anywhere distribution. To install prebuilt modules, copy the appropriate driver module to your PHP extensions directory (which can be found in php.ini). On Unix, you can also use a symbolic link. The following steps describe how to do this.
Locate the php.ini file for your PHP installation, and open it in a text editor. Locate the line that specifies the location of the extension_dir directory. If extension_dir is not set to any specific directory, set it to point to an isolated directory for better system security.
Copy the desired external environment PHP module from the SQL Anywhere installation directory to your PHP installation or extensions directory. Change the x.y to reflect the version you have selected.
For Windows, use a command like the following:
copy "%SQLANY16%\Bin32\php-5.x.y_sqlanywhere_extenv16.dll" php-ext-dir
For Unix, use a command like the following:
cp $SQLANY16/bin32/php-5.x.y_sqlanywhere_extenv16.so php-ext-dir
In the above examples, php-ext-dir is the path to your PHP extensions directory (for example, c:\php\ext).
Add a line to the Dynamic Extensions section of the php.ini file to load the external environment PHP module automatically. Change the x.y to reflect the version you have selected.
For Windows, add the following line:
For Unix, add the following line:
Save and close php.ini.
Make sure that you have also installed the SQL Anywhere PHP driver from the SQL Anywhere installation directory into your PHP extensions directory. This file name prefix follows the pattern php-5.x.y_sqlanywhere where x and y are the version numbers. It should match the version numbers of the file that you copied in step 2.
Discuss this page in DocCommentXchange.
|Copyright © 2014, SAP AG or an SAP affiliate company. - SAP Sybase SQL Anywhere 16.0|