Home  >  Article  >  Backend Development  >  How to modify the php.ini file in wamp

How to modify the php.ini file in wamp

PHPz
PHPzOriginal
2023-03-20 15:33:541505browse

Wampserver is a software package that can install Apache, PHP and MySQL on Windows computers. Develop and test PHP websites on your local computer easily with Wampserver. During the development process, we may need to modify the PHP configuration file php.ini. This article will introduce how to modify the php.ini file in Wampserver.

Step 1: Open Wampserver

First, make sure Wampserver is installed and started. In the Windows taskbar, you can see a green Wampserver icon. If the icon is red, it means that Wampserver did not start normally.

Step 2: Find the php.ini file

In Wampserver, the php.ini file is located in the php directory. You can open the php.ini file by left-clicking the Wampserver icon and selecting php→php.ini.

Step 3: Modify the php.ini file

In the opened php.ini file, you can see many configuration items. The following are some common configuration items that need to be modified:

  1. Modify the PHP time zone: Find the date.timezone configuration item in the php.ini file and change its value to the required time zone, such as Asia /Shanghai.
  2. Modify the maximum upload file size of PHP: Find the upload_max_filesize and post_max_size configuration items in the php.ini file, and modify their values ​​to the required size, such as 20M.
  3. Enable MySQL extension: Find the line ;extension=php_mysql.dll in the php.ini file, and remove the ";" in front, that is, extension=php_mysql.dll.

After modifying the php.ini file, you need to restart the service to take effect. You can right-click the Wampserver icon, select Exit to close the service, and then reopen Wampserver.

Summary:

Through the above steps, you can easily modify the php.ini file in Wampserver to modify the PHP configuration. During the development and testing process, PHP configuration items can be flexibly modified as needed to meet different needs.

The above is the detailed content of How to modify the php.ini file in wamp. 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