PHP Configuration (Basic Steps)

Step 1: Install XAMPP

Go to the website: apachefriends.org

Download and install XAMPP on your system.

Step 2: Start XAMPP

Open the XAMPP Control Panel.

Start both Apache and MySQL.

Step 3: Check PHP is Working

Go to the htdocs folder in your XAMPP installation.

Create a file named info.php and write this code:

<?php phpinfo(); ?>

Open browser and go to: http://localhost/info.php

If PHP is working, you'll see the PHP information page.

Step 4: Open php.ini File

Location: C:\xampp\php\php.ini

Open this file using Notepad or any text editor.

Step 5: Change Basic Settings (If Needed)

You can adjust things like:

  • upload_max_filesize = 10M
  • post_max_size = 12M
  • display_errors = On

After making changes, save the file and restart Apache.

Step 6: Where to Save PHP Files?

Save your PHP files inside the htdocs folder.

For example, if you save hello.php, you can open it in the browser like this:

http://localhost/hello.php

1. Save Location

Path: C:\xampp\htdocs\xyz

  1. Open C Drive
  2. Open xampp folder
  3. Open htdocs folder
  4. Create a new folder named xyz
  5. Inside the folder, create a file: index.php

2. Run the PHP Code Using a Local Server

  1. Open Google Chrome or any browser
  2. Click the address bar (URL bar)
  3. Type this and press Enter: localhost/xyz