Procedure documentationCreating and Installing the SAP MaxDB PHP Extension on Linux Locate this document in the navigation structure

 

You create the software for the MaxDB PHP extension from the source code and install this software on your computer.

Prerequisites

  • You have installed the following programs:

    • gcc compiler, version 2.95 or higher

    • autoconf, version 2.52 or higher

    • libtool, version 1.5.6 or higher

  • You have downloaded the source code for PHP 4.3.x or 5.0.x from http://php.net/downloads.php and unpacked it to a local directory <php_source> on your computer.

  • You installed the MaxDB SQLDBC software (Base and SQLDBC software components). In the following, the installation directory is referred to as <independent_program_path>.

    More information: Glossary, Installation

Recommendation Recommendation

To reproduce the test examples described in the following, you also require a database. For this reason we recommend that you install the complete MaxDB software first, create a database and load the tutorial data to this database.

End of the recommendation.

Procedure

  1. Create the directory <php_source>/ext/maxdb

  2. Download the MaxDB PHP package maxdb-<version>.tgz from http://pecl.php.net/package/maxdb and unpack it to a temporary directory on your computer:

    tar –C <tmp_folder> –xvzf maxdb-<version>.tgz

  3. Copy the contents of directory <maxdb_version> to the directory <php_source>/ext/maxdb:

    cp –r <tmp_folder>/<maxdb_version> <php_source>/ext/maxdb

  4. Go to the directory <php_source>:

    cd <php_source>

  5. Create the new scripts for compiling the source code: To do so, enter the following command:

    ./buildconf --force

  6. Specify the parameters for creating the PHP software with the SAP MaxDB extension:

    ./configure --with-maxdb=<independent_program_path> --prefix=<php_with_maxdb> [--<parameter>] [...]

    <parameter> :: = <option>=<value> | <option>

    • Using the option with-maxdb, define the directory <independent_program_path>.

      • If you have only installed the SAP MaxDB SQLDBC software, enter the installation directory of SQLDBC.

      • If you have installed the complete SAP MaxDB software, enter the directory for the programs and libraries used jointly by the SAP MaxDB databases and applications.

    • Using the prefix option, you can specify the directory <php_with_maxdb> into which PHP with the SAP MaxDB is to be installed. Note that you need write authorization for this directory in order to be able to create the software in it.

      If you do not specify this option, the system uses the /usr/local directory as default.

      Note Note

      To display all options, usse the following command:

      ./configure --help

      End of the note.
  7. Open a root shell and create and install PHP with SAP MaxDB extension using the following command:

    make install

Result

PHP with SAP MaxDB support has been compiled and installed.

To check whether the installation has been successful, display the list of all installed PHP extensions installed using the following command:

<php_with_maxdb>/bin/php –m

If no errors have occurred, the PHP extension maxdb is displayed in the list.

More information: Testing the SAP MaxDB PHP Extension on Linux

Example

You have unpacked the source code for PHP 5.0.0 to the directory /home/anna/php-5.0.0

You have installed the SQLDBC software in the directory /opt/sdb/programs

You create and install the SAP MaxDB PHP extension as follows:

  1. Create the directories /home/anna/php-5.0.0/ext and /home/anna/tmp

  2. Unpack the SAP MaxDB PHP package maxdb-7[1].5.00.24.tgz in the directory /home/anna/tmp:

    tar /home/anna/tmp maxdb-7[1].5.00.24.tgz

    You now have the following directory structure:

    /home/anna/php-5.0.0/

    ext/

    /home/anna/tmp/

    ext/

    maxdb/

    tests/

    <independent_program_path>/

    lib/

    sdk/

    incl/

    lib/

  3. Copy the contents of the directory <maxdb_php>/ext/maxdb to <php_source>/ext:

    cp –r /home/anna/tmp/ext/maxdb /home/anna/php-5.0.0/ext

  4. Go to the directory where you unpacked the PHP source code:

    cd /home/anna/php-5.0.0

  5. Create the new scripts for compiling the source code:

    ./buildconf –force

  6. Using options, specify that the programs and libraries used jointly by the SAP MaxDB databases and applications are stored in the directory /opt/sdb/programs, that PHP with SAP MaxDB extension is to be installed in the directory /usr and that the software is to be created both without CGI and without LIBXML support:

    ./configure --with-maxdb=/opt/sdb/programs --prefix=/usr --disable-cgi –-disable-libxml

  7. Create and install the PHP software with the SAP MaxDB extension:

    make install