After you install the XAMPP package and start Apache and MySQL, your environment should be ready to go. You can test your installation by performing the following in any order:
Opening the XAMPP Web page
Opening phpMyAdmin
Running a test PHP script
To test the XAMPP installation, follow these steps:
Open a browser.
Type localhost in the browser's address bar.
|
An XAMPP Web page displays, providing a choice of languages. In some cases, XAMPP has already set your language choice and doesn't ask again. In this case, you don't need to do Step 3 because your browser is already at the page shown in Figure 5-7.
Click your preferred language.
The XAMPP Welcome page displays, as shown in Figure 5-7.
If the Web page doesn't display, Apache may not be running. Use your Control Panel to manage Apache, as described in the previous section.
|
From the XAMPP Welcome page (see the preceding section), you can open phpMyAdmin to test whether it's installed. Click the phpMyAdmin link in the Tools section toward the bottom of the left panel. If phpMyAdmin is installed, it opens in your browser. Book III, Chapter 1 explains how to use phpMyAdmin.
If the phpMyAdmin page doesn't open, be sure Apache is started. You can manage Apache as described in the "Using the XAMPP Control Panel" section, earlier in this chapter.
To test whether PHP is installed and working, follow these steps:
Locate the directory in which your PHP scripts need to be saved.
This directory and the subdirectories within it are your Web space. This is the space where Apache looks for your scripts when you type localhost. This directory is called htdocs and is located in the directory where you installed XAMPP, such as c:xampphtdocs.
You can change the location of your Web space in the Apache configuration file. Changing Apache configuration is described in the section, "Configuring Apache," later in this chapter.
Create a text file in your Web space with the name test.php.
The file should contain the following content:
<html> <head><title>PHP test</title></head> <body> <?php phpinfo(); ?> </body></html>
Open a browser and type localhost/test.php into the address bar.
The output from this PHP script is a long list of settings and variables for your PHP installation, as shown in Figure 5-8.
Scroll down the list to find a section of settings for MySQL.
The software sections are listed in alphabetical order, starting with bcmath. The MySQL sections are located about half way down the list. You find two blocks, one headed mysql and one headed mysqli. The difference between mysql and mysqli is explained in Chapter 2 of this minibook.
When your PHP script runs correctly and the output includes a block of settings for MySQL support, your environment is ready for your development work.
If the PHP script doesn't run, be sure Apache is started. You can manage Apache as described in the "Using the XAMPP Control Panel" section, earlier in this chapter.
3.146.255.127