Testing the PHP extension

Once all of the required PHP components have been installed on your system, you can do a quick check to verify that the SQL Anywhere PHP extension is working correctly.

 To test the PHP extension
  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.

    dbeng12 samples-dir\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.

For more information, see Creating PHP test pages.