Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere 16.0 » SQL Anywhere Server - Programming » PHP support » SQL Anywhere PHP extension » How to build the SQL Anywhere PHP extension on Unix and Mac OS X

 

Adding the SQL Anywhere PHP extension files to the PHP source tree on Unix or Mac OS X

This topic describes the steps required to add the SQL Anywhere PHP extension files to the PHP source tree.

Prérequis

The following is a list of software you need to have on your system to complete to use the SQL Anywhere PHP extension on Unix and Mac OS X:

  • A SQL Anywhere installation, which can run on the same computer as the Apache web server, or on a different computer.

  • The source code for the SQL Anywhere PHP extension, which can be downloaded from [external link] http://download.sybase.com/ianywhere/php/2.0.3/src/sasql_php.zip.

    You also need sqlpp and libdblib16.so (Unix) or libdblib16.dylib (Mac OS X) installed (check your SQL Anywhere lib32 directory).

  • The PHP source code, which can be downloaded from [external link] http://www.php.net.

    For a list of supported versions, see [external link] http://www.sybase.com/detail?id=1068981.

  • The Apache web server source code, which can be downloaded from [external link] http://httpd.apache.org.

    If you are going to use a pre-built version of Apache, make sure that you have apache and apache-devel installed.

  • If you plan to use the Unified ODBC PHP extension, you need to have libdbodbc16.so (Unix) or libdbodbc16.dylib (Mac OS X) installed (check your SQL Anywhere lib32 directory).

The following binaries should be installed from your Unix installation disk if they are not already installed, and can be found as RPMs:

  • make
  • automake
  • autoconf
  • libtool (glibtool for Mac OS X)
  • makeinfo
  • bison
  • gcc
  • cpp
  • glibc-devel
  • kernel-headers
  • flex

You must have the same access privileges as the person who installed PHP to perform certain steps of the installation. Most Unix-based systems offer a sudo command that allows users with insufficient permissions to execute certain commands as a user with the right to execute them.

Contexte et remarques

You must have the same access privileges as the person who installed PHP to perform certain steps of the installation. Most Unix-based systems offer a sudo command that allows users with insufficient permissions to execute certain commands as a user with the right to execute them.

 Task
  1. Download the SQL Anywhere PHP extension source code from [external link] http://www.sybase.com/detail?id=1019698. Look for the section entitled Building the Driver from Source.

  2. From the directory where you saved the SQL Anywhere PHP extension, extract the files to the ext subdirectory of the PHP source tree (Mac OS X users should replace tar with gnutar):

    $ tar -xzf sasql_php.zip -C PHP-source-directory/ext/
    

    The following example is for PHP version 5.2.11. You must change php-5.2.11 below to the version of PHP you are using.

    $ tar -xzf sqlanywhere_php-1.0.8.tar.gz -C ~/php-5.2.11/ext
  3. Make PHP aware of the extension:

    $ cd PHP-source-directory/ext/sqlanywhere
    $ touch *
    $ cd ~/PHP-source-directory
    $ ./buildconf

    The following example is for PHP version 5.2.11. You must change php-5.2.11 below to the version of PHP you are using.

    $ cd ~/php-5.2.11/ext/sqlanywhere
    $ touch *
    $ cd ~/php-5.2.11
    $ ./buildconf
  4. Verify that PHP is aware of the extension:

    $ ./configure -help | egrep sqlanywhere

Résultat

If you were successful in making PHP aware of the SQL Anywhere extension, you should see the following text:

--with-sqlanywhere=[DIR]

If you are unsuccessful, keep track of the output of this command and post it to the SQL Anywhere Forum at [external link] http://sqlanywhere-forum.sybase.com for assistance.