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

 

Testing the PHP extension

Perform a quick check to verify that the SQL Anywhere PHP extension is working correctly.

Prérequis

All of the required PHP components should be installed on your system

 Task
  1. Make sure that the bin32 subdirectory of your SQL Anywhere installation is in your path. The SQL Anywhere PHP extension requires the bin32 directory to be in your path.

  2. At a command prompt, run the following command to start the SQL Anywhere sample database.

    dbsrv16 "%SQLANYSAMP16%\demo.db"

    The command starts a database server using the sample database.

  3. At a command prompt, change to the SDK\PHP\Examples subdirectory of your SQL Anywhere installation. Make sure that the php executable directory is included in your path. Enter the following command:

    php test.php

    Messages similar to the following should appear. If the PHP command is not recognized, verify that PHP is in your path.

    Installation successful
    Using php-5.2.11_sqlanywhere.dll
    Connected successfully

    If the SQL Anywhere PHP extension does not load, you can use the command "php -i" for helpful information about your PHP setup. Search for extension_dir and sqlanywhere in the output from this command.

  4. When you are done, stop the SQL Anywhere database server by clicking Shut Down in the database server messages window.

Résultat

The tests should succeed, indicating that the SQL Anywhere PHP extension is working correctly.

 See also