Procedure documentationTesting the PHP Library on Microsoft Windows Locate this document in the navigation structure

 

You test the functions of the SAP MaxDB PHP extension. You can either use the test scenario included in the SAP MaxDB PHP package or develop your own tests.

Prerequisites

  • You have installed the SAP MaxDB PHP library.

    More information: Installing the SAP MaxDB PHP Library on Microsoft Windows

  • You have installed the SAP MaxDB software and created a database. This must be located on the same computer as the PHP installation. If you want to use the SAP MaxDB test scenario, you need to have loaded the demo data into the database.

    More information: Concepts of the Database System, Demo Database

  • If you want to use the SAP MaxDB test scenario, you also need to download the SAP MaxDB source package from pecl.php.net/package/maxdb and unpack it into the <maxdb_php> directory. The test programs are contained in this package.

Procedure

  1. Open the php.ini file in your Microsoft Windows directory and add the following information:

    [maxdb]

    maxdb.default_db=<database_name>

    maxdb.default_user=<database_user_name>

    maxdb.default_pw=<database_user_password>

  2. Go to the directory <test_program_folder> containing the test programs:

    cd <test_program_folder>

  3. Run the individual test programs. Enter the following command to execute the <test_program>:

    php <test_program>

Example

You have unpacked the PHP binary distribution to the directory C:\php-5.0.0-Win32

You have installed the SAP MaxDB PHP library for Microsoft Windows in the C:\WINDOWS directory.

You have unpacked the SAP MaxDB source package in the directory C:\php-5.0.0-Win32\ext\maxdb\tests

You have installed the SAP MaxDB software and created the DEMODB database as well as the database user MONA with the password RED.

You use the SAP MaxDB test scenario.

  1. Open the file C:\WINDOWS\php.ini using a text editor and add the following information:

    [maxdb]

    maxdb.default_db=DEMODB

    maxdb.default_user=MONA

    maxdb.default_pw=RED

  2. Go to the directory containing the SAP MaxDB PHP test programs:

    cd C:\php-5.0.0-Win32\ext\maxdb\tests

  3. Execute the maxdb001.php test program:

    php maxdb001.php

Note Note

The PHP binary distribution for Microsoft Windows does not include a test frame. You therefore need to execute each test program for the SAP MaxDB PHP library individually.

End of the note.