Create PHP test page ZT to test whether PHP settings are correct, the following process describes how to create and run a Web page that calls phpinfo. Phpinfo () is a PHP function that generates a system setting information page. The output shows whether PHP works properly.
For information on installing PHP, see http://us2.php.net/install.
Create a PHP information test page
Create a file named info. php in the root directory of the Web content.
If you are not sure which directory to use, check the Web server configuration file. In the Apache installation directory, the content directory is usually named htdocs. If Mac OS X is used, the directory name of the Web content may depend on the account used:
If you are a system administrator on Mac OS X, use/Library/WebServer/Documents.
If you are a Mac OS X user, put the file in/Users/[your username]/Sites.
Insert the following code into this file:
Alternatively, once PHP is correctly installed and configured, you can run the following command at the command prompt to create a test Web page.
php -i > info.html
This confirms whether the installed PHP and Apache work properly together.
Test whether PHP and Apache can work normally with Adaptive Server Anywhere:
Copy the connect. php file from the PHP sample directory to the root directory of the Web content.
Access the connect. php page from a Web browser.
Message displayed
Connection successful
.
Create a query page using the SQLAnywhere PHP module
In the root directory of the Web content, create a file named asa_test.php that contains the following PHP code:
Insert the following PHP code into this file: