Home > Backend Development > PHP Tutorial > Building a PHP development environment under Windows_PHP tutorial

Building a PHP development environment under Windows_PHP tutorial

WBOY
Release: 2016-07-20 11:15:31
Original
907 people have browsed it

There are many PHP integrated development environments, such as XAMPP, AppServ... Just one-click installation will set up the PHP environment. However, this installation method is not flexible enough, it is inconvenient to freely combine software, and it is not conducive to learning. Therefore, I still prefer to build a PHP development environment manually. I can just install which modules I need, or if that software needs to be upgraded, I can just upgrade that software directly. It does not affect other software, which is very convenient.

 

  • Apache httpd-2.2.22-win32-x86-openssl-0.9.8t.msi
  • PHP php-5.3.10-Win32-VC9-x86.zip
  • MySQL mysql-5.5.20-win32.msi

 

 : Double-click installation is no different from installing other Windows software. When filling in Server Information, there are no special regulations, as long as the entered information conforms to the format.

Building a PHP development environment under Windows_PHP tutorial: Extract php-5.3.10-Win32-VC9-x86.zip to a directory.

 

 Install MySQL: Double-click to install. If you need to change the installation directory, select Custom

in Choose Setup Type

Building a PHP development environment under Windows_PHP tutorial3. Integrate Apache+PHP+MySQL

Apache: First modify the Apache configuration file so that Apache supports parsing PHP files. The Apache configuration file is httpd.conf in the conf directory of the Apache installation directory.

1. Let Apache parse the php file and find

in the configuration file

    #LoadModule vhost_alias_module modules/mod_vhost_alias.so

Add in the next line (the green position is based on the directory where PHP is located)

    LoadModule php5_module ""
  PHPIniDir " "
AddType application/x-httpd-php .php .html .htm

 2. Find

in the configuration file

DirectoryIndex index.html

Change to

   DirectoryIndex index.html

3. Modify the Apache site directory and find it in the configuration file (the values ​​displayed are different depending on the directory where Apache is installed)

   DocumentRoot ""

Change to

   DocumentRoot ""

  

Find again

   ">

Change to

   "> 

PHP: Rename php.ini-development to php.ini as the PHP configuration file. Modify php.ini

1. Set the specific directory of the PHP extension package and find

    ; On windows:
    extension_dir = "ext"

Change to (the value is the directory of the ext folder)

   ; On windows:
   extension_dir = ""

2. Enable the corresponding library function and find the line where the library needs to be enabled

; extension=php_curl.dll

; extension=php_gd2.dll

; extension=php_mbstring.dll

; extension=php_mysql.dll

; extension=php_xmlrpc.dll

Remove the semicolon (comment) in front and change it to

extension=php_curl.dll

extension=php_gd2.dll

extension=php_mbstring.dll

extension=php_mysql.dll

extension=php_xmlrpc.dll

  

3. Set the time zone and find

; date.timezone =

Change to

Date.timezone = Asia/Shanghai

  

The configuration is complete, check whether the configuration is successful. Restart Apache, create a new file index.php in the site directory, and enter the content:

Building a PHP development environment under Windows_PHP tutorial
<?php<br />    <span phpinfo</span>();<br />?>
Copy after login
Building a PHP development environment under Windows_PHP tutorial

Open the browser and enter http://localhost. If the following content is displayed, the installation is successful and MySQL is successfully associated.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/440187.htmlTechArticleThere are many PHP integrated development environments, such as XAMPP, AppServ... Just install PHP with one click The environment is set up. However, this installation method is not flexible enough, and the free combination of software is inconvenient. At the same time...
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