Home > Backend Development > PHP Tutorial > Installation and configuration method of PHP5.2.17 under Windows system

Installation and configuration method of PHP5.2.17 under Windows system

WBOY
Release: 2024-03-05 09:38:01
Original
561 people have browsed it

Installation and configuration method of PHP5.2.17 under Windows system

Installation and configuration method of PHP5.2.17 under Windows system

PHP (Hypertext Preprocessor) is a general open source scripting language, especially suitable for websites development. Under Windows systems, installing PHP can help developers develop dynamic web pages. This article will introduce how to install and configure PHP5.2.17 under Windows system. I hope it will be helpful to the installation and configuration of PHP under Windows.

Step one: Download the PHP5.2.17 installation package

First, you need to download PHP5 from the official website of PHP (http://php.net/releases/) .2.17 installation package, select the version that matches your operating system to download. After the download is complete, unzip it to a suitable directory, such as C:php.

Step 2: Configure PHP

  1. Open the C:php directory and find php.ini-recommended file, make a copy of it and rename it to php.ini.
  2. Use a text editor (such as Notepad) to open the php.ini file. You can make some configuration modifications according to the specific situation, such as:

    • Settings Time zone: date.timezone = Asia/Shanghai
    • Enable extension module: Remove the semicolon (;) in front of the extension module that needs to be enabled, such as extension=php_mysql.dll.
  3. Save the php.ini file.

Step 3: Configure the Apache server

When building a PHP development environment under Windows systems, the Apache server is usually used. The next step is to configure the Apache server to load the PHP module.

  1. Open the Apache configuration file httpd.conf, usually in the conf folder under the Apache installation directory.
  2. Find the LoadModule section in the httpd.conf file and add the following code:

    LoadModule php5_module "C:/php/php5apache2_2.dll"
    AddType application/x-httpd-php .php
    PHPIniDir "C:/php"
    Copy after login
  3. Save httpd.conf file and restart the Apache server.

Step 4: Test PHP

  1. Create a in Apache’s htdocs directory phpinfo.php file, the file content is:

    <?php
    phpinfo();
    ?>
    Copy after login
  2. Open the browser, enter http://localhost/phpinfo.php to access, if you can see PHP information page, indicating that PHP has been successfully installed and configured.

Through the above steps, we successfully installed and configured PHP5.2.17 under the Windows system and tested it through the Apache server. I hope this article will be helpful to friends who want to set up a PHP development environment under Windows systems.

The above is the detailed content of Installation and configuration method of PHP5.2.17 under Windows system. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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