PHP Runtime Environment configuration under Windows

Source: Internet
Author: User
This article mainly introduces the use of Windows under the PHP operating environment configuration, has a certain reference value, now share to everyone, the need for friends can refer to

Operating Environment apache+php

We will download the Apache installation package directly from the Internet (remember that the version number is always, VC11,VC14,VC17, respectively, in different versions of VC + + written, here are used Vc11)

First, we download the PHP package from the Web

And then download it down and we unzip it


This is just a folder, the previous old version also needs to be installed, the later version will not need to install.

Here the small codec path is placed directly in the F-disk PHP1 directory


Then we find php.ini-development Direct copy renamed to php.ini.



Then we open the configuration file, make changes, the inside of the extension, which is the PHP call module, as long as the field before the semicolon removed, you can open the function of this module. This step should be done according to the requirements you use.


Then we set the encoding format,default_charset field with ctrl+f shortcut key to find


Input default_charset= "Utf-8"

Then you need to set the environment variable


Enter the path of the Ext folder in Path



Now that PHP is configured, then we'll configure Apache

In the same way, we still need to download VC11 's Apache service from our official website.


Here the small part has been unzipped, and then need to open the Apache configuration file


The open path has not been set because the file was just downloaded. So find serverroot to get rid of the path behind , change to your Apache now path.


Then we need to modify the listening port, because the Apache service's default 80 port is already occupied, so the small codec here set the port to 8089 port


Then we can start the Apache server, we find the file to start directly, with the command can also (CD to the Apache installation Bin directory to enter. re-enter httpd.exe-k start will be available )



Here Apache service has been started, here to add a small part, in fact, the Apache service relies on VC + +, so we must install VC + + on the computer can, in fact, in the Readme file of Apache has been explained


If there is no corresponding VC version is unable to start the Apache service


Here English is not good classmate is a bit GG, but do not hinder, we can translate on the Internet can, and then it gives the download address, here Small series didn't find download file, all English official website, you know, here prompt to install vc++2012 We direct search download is the same effect


And then it's a stupid installation, and here's a little sticker on the installed



After the installation is complete, there will be no error, and then we can verify it in the Web page.


Here our Apache service has been able to work properly

Then we need to integrate PHP into the Apache operating environment.

Add the contents of the image to the httpd.conf file, and two paths are the file paths of PHP. note php5_module the "Phpapache2_4.dll" in the back path is the same as the Apache version that you downloaded yourself.



Then set up the Apache server's working directory


Set the service name, which is the path we access


Then we build the index.php file under the working directory of the Setup

The file content is the output PHP information


OK, let's preview it in the webpage.


Here, apache+php running environment has been set up, MySQL integration will be updated later, please look forward to!!!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.