When developing PHP, it is essential to build a complete PHP running environment. WAMP is an environment under Windows that integrates web server (Apache), database (MySQL) and PHP, which greatly facilitates the work of PHP developers. This article will introduce how to set up a WAMP PHP operating environment.
1. Download the installation package
WAMP can be downloaded from its official website (https://www.wampserver.com/en/). After opening the official website, select the required installation package to download. It is recommended to choose the latest version to download for better user experience and better compatibility.
2. Install WAMP
- Double-click the downloaded installation package and click "Next" to start the installation.
- Select the installation path, it is recommended to use the default path.
- Select the PHP version, it is recommended to choose the latest version.
- Select the MySQL version. It is recommended to choose the latest version.
- Configure the Apache port number. It is recommended to use the default port number.
- Configure the SMTP server. It is recommended not to configure it.
- After the installation process is completed, click Finish.
3. Test whether WAMP is installed successfully
- Open WAMP and start the Apache and MySQL services.
- Enter the root directory of WAMP in the file browser and find the www folder.
- Create a new test text file "info.php" in the www folder and enter the following code:
<?php phpinfo(); ?>
- Open the browser and enter "http:// localhost/info.php" to access.
- If the PHP information page appears, the installation is successful.
4. Configure WAMP
- Set WAMP language: The default language of WAMP is French. If you need to change it to English or other languages, you can modify it through WAMP settings. Select "Language" in the WAMP main interface and select the desired language.
- Modify the default port number of Apache: By default, the default port number of Apache is 80. If you need to change the default port of the Apache service, you can change 80 in the configuration file httpd.conf to another port number (such as 8080), and restart the Apache service to take effect.
- Set up a virtual host: Normally, a Web server can support access from multiple domain names or host names, which requires setting up a virtual host. For specific setting methods, you can refer to Apache's official documentation, or select "Add a Virtual Host" in the WAMP main interface to set it up.
5. Summary
WAMP is one of the most commonly used PHP operating environments under Windows. It is simple and convenient to install, which can save users a lot of time and energy. This article mainly introduces how to download and install WAMP, perform basic configuration and test whether the installation is successful. I hope it can help readers quickly build a good PHP operating environment.
The above is the detailed content of wamp php running environment construction. For more information, please follow other related articles on the PHP Chinese website!
Statement: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