Introduction to the SQL Anywhere PHP module

PHP, which stands for PHP: Hypertext Preprocessor, is an open source scripting language. Although it can be used as a general-purpose scripting language, it was designed to be a convenient language in which to write scripts that could be embedded with HTML documents. Unlike scripts written in JavaScript, which are frequently executed by the client, PHP scripts are processed by the web server, and the resulting HTML output sent to the clients. The syntax of PHP is derived from that of other popular languages, such as Java and Perl.

To make it a convenient language in which to develop dynamic web pages, PHP provides the ability to retrieve information from many popular databases, such as SQL Anywhere. Included with SQL Anywhere are two modules that provide access to SQL Anywhere databases from PHP. You can use these modules and the PHP language to write standalone scripts and create dynamic web pages that rely on information stored in SQL Anywhere databases.

Prebuilt versions of the PHP modules are provided for Windows, Linux, and Solaris and are installed in the operating-system-specific binaries subdirectories of your SQL Anywhere installation. Source code for the SQLAnywhere PHP module is installed in the sdk\php subdirectory of your SQL Anywhere installation.

Additional information can also be found online at [external link] The SQL Anywhere PHP Module.

Requirements

Before you can use the SQL Anywhere PHP module, you must also install the following components:

  • The PHP 5 binaries for your platform, which can be downloaded from [external link] http://www.php.net. SQL Anywhere provides prebuilt PHP modules for PHP versions 5.1.1 to 5.2.6. At the time of writing, PHP version 5.2.6 was the most recent stable release. For Windows platforms, the thread-safe version of PHP must be used with the SQL Anywhere PHP module.

  • A web server, if you want to run PHP scripts within a web server. Note that SQL Anywhere can be used as a web server.

    You can also use a different web server such as Apache HTTP Server. SQL Anywhere can be run on the same computer as the web server, or on a different computer.

  • For Windows, the SQL Anywhere client software dblib11.dll and dbcapi.dll.

  • For Linux/Unix, the SQL Anywhere client software libdblib11.so and libdbcapi.so.

  • For Mac OS X, the SQL Anywhere client software libdblib11.dylib and libdbapi.dylib.

For additional information about installing PHP and the Apache HTTP Server, see [external link] Serving Content from SQL Anywhere Databases Using Apache and PHP.

The following sections provide assistance with installing the SQL Anywhere PHP module.