Testing the PHP installation (Macintosh)
You can test the Apache Web server and the PHP application server on the Macintosh by running a test page.
However, when using a WEB server to work with the contents of PHP pages and MySQL databases, you must first configure the server so that it can use PHP and MySQL.
To test your Apache Web server and your PHP application server, do the following:
1, configure the server as described in the articles on the Macromedia Web site.
2. In Dreamweaver or any text editor, create a plain text file and name it timetest.php.
3, in the file, enter the following code:
<p>this page is created at <b>
<?php echo Date ("H:i:s a", Time ());?>
</b> on the computer running php.</p>
This code displays the time that the page was processed on the server.
4, copy this file to the/users/your_user_name/sites folder on the Macintosh.
The Sites folder is your Apache Web server personal root folder.
5, in your Web browser, enter the following URL, and then press RETURN:
http://localhost/~your_user_name/timetest.php
The test page should open and display the time as follows:
The specified time is called dynamic content because it changes every time you request the page. Click the Refresh button on the browser to generate a new page with a different time.
Note: Viewing the source code (View > View source files in Safari) confirms that the page does not use any client JavaScript to achieve this effect.
If the page does not work as expected, check to see if the following errors may exist:
- The file does not have a. php extension.
- The URL contains a typing error. Check for errors and ensure that there are no slashes after the filename, such as http://localhost/~your_user_name/timetest.php/. Also ensure that your username is preceded by a tilde (~).
- The page code contains a typing error.
- The Apache server is not running. Open System Preferences, and in the sharing category, see if personal Web sharing is enabled.
- After you test the server software, create a root folder for your Web application.