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

SQL Anywhere 12.0.1 » SQL Anywhere 服务器 - 编程 » PHP 支持 » SQL Anywhere PHP 扩展 » 如何在 UNIX 和 Mac OS X 上构建 SQL Anywhere PHP 扩展

 

将 SQL Anywhere PHP 扩展文件添加到 PHP 源树

  1. [external link] http://www.sybase.com/detail?id=1019698 下载 SQL Anywhere PHP 扩展源代码。查找标题为 Building the Driver from Source 的部分。

  2. 将文件从保存 SQL Anywhere PHP 扩展的目录抽取到 PHP 源树的 ext 子目录中(Mac OS X 用户应该用 gnutar 替换 tar):

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

    例如:

    $ tar -xzf sqlanywhere_php-1.0.8.tar.gz -C ~/php-5.2.11/ext
  3. 让 PHP 接受该扩展:

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

    以下示例适用于 PHP 5.2.11 版。必须将下面的 php-5.2.11 改为正在使用的 PHP 版本。

    $ cd ~/php-5.2.11/ext/sqlanywhere
    $ touch *
    $ cd ~/php-5.2.11
    $ ./buildconf
  4. 验证 PHP 是否接受该扩展:

    $ ./configure -help | egrep sqlanywhere

    如果已成功让 PHP 接受了 SQL Anywhere 扩展,则应看到以下文本:

    --with-sqlanywhere=[DIR]

    如果未成功,则跟踪此命令的输出并将其发布到 SQL Anywhere 论坛 ([external link] http://sqlanywhere-forum.sybase.com/) 以寻求帮助。