How to install XAMPP on Windows computer and configure PHP environment

PHPz
Release: 2023-04-03 14:38:01
Original
1076 people have browsed it

XAMPP is an open source web server application that can be used under operating systems such as Windows, Linux and Mac OS X. It includes Apache HTTP server, MySQL database, PHP interpreter and Perl interpreter. XAMPP is a very convenient tool during the development and testing phases because it can simulate a complete web server environment on the local computer or server. This article will introduce how to install XAMPP on a Windows computer and configure the PHP environment.

1. Download and install XAMPP

  1. Open the official website of XAMPP (https://www.apachefriends.org/index.html), and then click "XAMPP for Windows" link.
  2. Find the version you need (32-bit or 64-bit) and click the download button to start the download.
  3. After the download is completed, double-click the .exe file and follow the prompts to install XAMPP on your computer. By default, it will be installed under C:\xampp.

2. Configure the PHP environment

  1. Open the XAMPP installation directory, find the php.ini file, it is located under ..\xampp\php, right-click the file and Select Edit.
  2. Now you will see a long string of text, which is the PHP configuration file. It is recommended to use the "search" function (ctrl f) to find the setting you need to change.
  3. You can make the following changes to the php.ini file as needed:

(1) Modify the time zone: Find the [Date] section in the php.ini file and change; date.timezone Remove the semicolon in =, and then add the time zone you need after the equal sign (such as date.timezone = "Asia/Shanghai").

(2) Turn on PHP error reporting: You can set the error_reporting value to E_ALL or E_ALL & ~E_NOTICE, and set the display_errors value to On, so that when PHP runs with an error, it will display error information.

(3) Upload file size limit: Find upload_max_filesize and post_max_size and set them to the size you need (in M).

(4) Open the PHP extension module: remove the semicolon in front of the extension module you need to use (such as curl or mysqli).

  1. After saving and closing the php.ini file, restart XAMPP’s Apache server and MySQL database.

3. Check whether the configuration is successful

  1. Open the XAMPP homepage (http://localhost/xampp/).
  2. If you see a card that says "Welcome to XAMPP for Windows!" it means you have successfully installed it.
  3. Open the phpinfo page, you can also check whether your PHP configuration is working properly. Type http://localhost/xampp/phpinfo.php in your browser and press Enter. If successful, it will display details about the PHP environment and server configuration.

Summary

The process of installing and configuring XAMPP is very simple and can be completed in just a few steps. However, since everyone's needs are different, you may need to make some adjustments to suit your needs. After you understand some of the options in the PHP configuration file, you can make more customized settings for XAMPP.

The above is the detailed content of How to install XAMPP on Windows computer and configure PHP environment. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template