To test whether PHP is set up correctly, the following procedure describes how to create and run a Web page that calls Phpinfo (). Phpinfo () is a PHP function that generates a system settings information page. The output will show whether PHP is working 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 your Web content.
If you are not sure which directory to use, check the WEB server's configuration file. In the Apache installation directory, the content directory is typically named Htdocs. If you are using a directory name for Mac OS x,web content, it may depend on the account you are using:
If you are a system administrator on a MAC OS X system, use/library/webserver/documents.
If you are a Mac OS X user, place the file in/users/[your username]/sites/.
Insert the following code into this file:
Or, once PHP is installed and configured correctly, you can also create a test Web page by executing the following command at a command prompt.
Php-i > info.html
This confirms that the installed PHP and Apache will work together properly.
Test to see if PHP and Apache work together 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.
The message should now be displayed
Connection Successful
。
Create a query page that uses the Sqlanywhere PHP module
Under 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: