Home  >  Article  >  Backend Development  >  What to do if win10 fails to build php7.1

What to do if win10 fails to build php7.1

藏色散人
藏色散人Original
2022-12-01 10:08:526362browse

Solution to the failure of building php7.1 on win10: 1. Open the php.ini file; 2. Uncomment "extension=php_curl.dll extension=php_gd2.dll"; 3. Modify the configuration to "session. save_path = "D:/phpsessiontmp""; 4. Configure PHP's file upload function; 5. Modify "date.timezone".

What to do if win10 fails to build php7.1

The operating environment of this tutorial: Windows 7 system, php7.1 version, Dell G3 computer.

What to do if win10 fails to build php7.1?

How to build a PHP7.1 development environment under win10

Download this version at http://windows.php.net/download#php-7.1

IIS is generally used with the NTS (non thread safe) version, and Apache is used with the TS (thread safe) version.

Find the two configuration files php.ini.development and php.ini.production in the PHP root directory.

php.ini-development is suitable for development programs (for testing) php.ini-production has higher security settings and is suitable for use as a product online

Generally use php.ini -Production is changed to php.ini, ensuring that the test environment (local) is consistent with the official environment (online)

Use a text editor such as sublime to open the php.ini file and modify the configuration.

INI file specific configuration:

1) extension_dir = “C:/php5/ext”

2) Uncomment the following settings:

  extension=php_curl.dll
  extension=php_gd2.dll
  extension=php_mbstring.dll
  extension=php_mysql.dll
  extension=php_pdo_mysql.dll
  extension=php_pdo_odbc.dll
  extension=php_xmlrpc.dll

3) Configure the Session function:

When using the session function, you must configure the directory where the session file is saved on the server, otherwise the session cannot be used. Create a new read-write directory folder on Windows 7. This directory It is best to create a phpsessiontmp directory on the root directory of the D drive independently of the WEB main program directory, and then find it in the php.ini configuration file; session.save_path = "/tmp" and change it to session.save_path = "D:/ phpsessiontmp"

4) Configure PHP's file upload function

Like session, when using PHP file upload function, we must specify a temporary folder to complete the file upload function, otherwise the file The upload function will fail. We still need to create a readable and writable directory folder on Windows 7. Here I created the phpfileuploadtmp directory on the root directory of drive D, and then found it in the php.ini configuration file; upload_tmp_dir = changed to upload_tmp_dir = "D:/phpfileuploadtmp"

5) Modify date.timezone

 ;date.timezone = 改成 date.timezone = Asia/Shanghai

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of What to do if win10 fails to build php7.1. 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