Home > Backend Development > PHP Problem > PHP5.6 download and installation tutorial under Windows

PHP5.6 download and installation tutorial under Windows

PHPz
Release: 2023-04-06 10:10:01
Original
2759 people have browsed it

For web developers, installing PHP is an essential step, and PHP 5.6 version is the version currently used by most websites. This article will introduce how to download and install PHP5.6 in Windows systems.

Step one: Download PHP5.6

Before downloading PHP5.6, you need to determine whether your computer is a 32-bit or 64-bit system. Here we take a 64-bit system as an example.

Open the browser and enter PHP’s official website: http://windows.php.net/download/.

Find the line "PHP 5.6.x VC11 x64 Non Thread Safe" and click the download link to download.

After the download is complete, decompress the compressed package to the directory you want to install, for example, create a php folder in the root directory of the C drive, and move the decompressed folder to the php folder.

Step 2: Configure PHP

  1. Open the decompressed PHP folder, find the php.ini-development file, copy it, and name the copied file Change to php.ini.
  2. Right-click on the php.ini file and select "Edit" to open the file.
  3. In the opened php.ini file, find the "extension_dir" field, uncomment and set the value to the directory where the PHP extension module is located. In this example, set it to "extension_dir = "c:\php\ext"" (note that "c:\php" is changed to the path of your PHP folder).
  4. In the opened php.ini file, find "extension=mysqli" and "extension=openssl", uncomment and save.

Step 3: Configure Apache

If you have not installed Apache, please install Apache first. This article will not go into details.

Add the downloaded and unzipped PHP folder to the system path.

  1. Open the Apache installation directory and find the httpd.conf file.
  2. Right-click the httpd.conf file, select "Edit" to open the file, and find the following code:

LoadModule rewrite_module modules/mod_rewrite.so

Uncomment this One line, as shown below:

LoadModule rewrite_module modules/mod_rewrite.so

  1. Find the following code:

AddType application/x-gzip .tgz

Make changes as follows:

AddType application/x-httpd-php .php

AddType application/x-httpd-php .html

  1. Add the following code at the end of the code:

DirectoryIndex index.html index.php
Copy after login

  1. Save and exit httpd .conf file.

Step 4: Test PHP

  1. Restart the Apache server.
  2. Create a phpinfo.php file in the htdocs folder under the Apache installation directory.
  3. Enter the following code in the phpinfo.php file:

phpinfo();

?>

  1. Save and exit the phpinfo.php file.
  2. Open the browser, enter "http://localhost/phpinfo.php" in the address bar, and press Enter. If the PHP information page is displayed, it means that PHP has been successfully installed and configured.

Summary

The above are the detailed steps and precautions for downloading and installing PHP5.6 in Windows systems. If a problem occurs after you install it according to the above steps, you can try to reinstall it, or refer to the online information to troubleshoot. I wish you success in completing your tasks when learning and developing PHP.

The above is the detailed content of PHP5.6 download and installation tutorial under Windows. 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