Procedure documentationInstalling the SAP MaxDB PHP Library on Microsoft Windows Locate this document in the navigation structure

 

You install the SAP MaxDB PHP library php_maxdb.dll on Microsoft Windows to use the SAP MaxDB PHP extension.

Prerequisites

  • You have downloaded the PHP binary distribution for Microsoft Windows. You can find this here: http://php.net/downloads.php.

  • You have downloaded the appropriate SAP MaxDB PHP library for your PHP version. The PHP5 and PHP4 libraries can be found here: http://pecl4win.php.net

  • You have installed the SAP MaxDB SQLDBC software (software components Base and SQLDBC). The SQLDBC files are stored in the following directories:

    • Microsoft Windows:

      <installation_path>\pgm

    • Unix/Linux:

      <installation_path>\lib or <installation_path>\lib\lib64

    Note Note

    You can display the installation path using the dbm_getpath DBM command:

    dbmcli dbm_getpath InstallationPath

    For more information, see Database Manager CLI, dbm_getpath.

    End of the note.

Note Note

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

End of the note.

Procedure

  1. Unpack the PHP binary distribution to a local directory <php_binary> on your computer.

  2. Select the appropriate SAP MaxDB PHP library for your PHP version and unpack it to the directory containing the extensions for the PHP binary distribution:

    • For PHP5, unpack the package to <php_binary>\ext

    • For PHP4, unpack the package to <php_binary>\extensions

  3. Copy the file php.ini-recommended from the <php_binary> directory to the directory of your version of Microsoft Windows <win_dir> and rename it to php.ini:

    copy <php_binary>\php.ini-recommended <win_dir>\php.ini

  4. Open the php.ini file in an editor and add the following line to the Dynamic Extensions section:

    extension=php_maxdb.dll

  5. Look for extension_dir in the php.ini file and enter the directory containing the extensions for the PHP binary distribution of your PHP version.

    • For PHP5, enter:

      extension_dir="<php_binary>\ext"

    • For PHP4, enter:

      extension_dir="<php_binary>\extensions"

  6. Save your changes and close the php.ini file.

  7. Enter the necessary paths to the PATH environment variable:

    SET PATH=%PATH%;<php_binary>;<php_binary>\ext

Result

The SAP MaxDB PHP library has been installed.

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

php -m

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

More information: Testing the PHP Library on Microsoft Windows

Example

You are using PHP5 and want to install the SAP MaxDB PHP extension for Microsoft Windows (32 bit).

You are using the Windows XP operating system and this is installed in the C:\WINDOWS directory.

  1. Unpack PHP 5.0.0 to the directory C:\php-5.0.0-Win32.

  2. Unpack the phpmaxdb.dll package to C:\php-5.0.0-Win32\ext.

  3. Copy the file php.ini-recommended from the C:\php-5.0.0-Win32 directory to the C:\WINDOWS directory and rename it php.ini:

    copy C:\php-5.0.0-Win32\php.ini-recommended C:\WINDOWS\php.ini

  4. Open the php.ini file in an editor and add the following line to the Dynamic Extensions section:

    extension=php_maxdb.dll

  5. Look for extension_dir in the php.ini file and enter the directory C:\php-5.0.0-Win32\ext.

    extension_dir=″c:\php-5.0.0-Win32\ext″

  6. Save your changes and close the php.ini file.

  7. Enter the necessary paths to the PATH environment variable:

    SET PATH=%PATH%;C:\php-5.0.0-Win32;C:\php-5.0.0-Win32\ext