Tutorial on installing and configuring the PHP + Apache + Mysql environment in Windows 7

Source: Internet
Author: User
Tags install php on windows php file upload

I installed Windows 7 in the past two days. Some time ago, a friend asked me how to install and build the PHP environment in Windows. So I plan to work hard to build the PHP environment step by step, currently, you do not need to use the PHP environment to build software. Here is a detailed tutorial on installing and configuring the PHP + Apache + Mysql environment in Windows 7, hoping to help PHP beginners.

To build a PHP environment in Windows 7, you must first download the PHP code package and the installation package for Apache and Mysql.

PHP version: php-5.3.2-Win32-VC6-x86, VC9 is specifically customized for IIS, VC6 is provided for other WEB service software, such as Apache. I downloaded a ZIP package.

Mysql version: mysql-essential-5.1.45-win32, MySQL Community Server 5.1.45,

Apache version: httpd-2.2.15-win32-x86-openssl-0.9.8m-r2, openssl indicates with openssl module, use openssl to configure SSL security link for Apache

Step 1: Install the Apache service in Windows 7.

Here, we mainly configure the Network Domain, Server Name, Email address, and port used by the Apache service. The default port is port 80. You can configure it on other ports as needed, you can use the default directory or select the installation directory as needed.


After installing the apache service, enter http: // localhost/in the browser to display It's work! Indicates that the Apache service is successfully installed.

Step 2: Install Mysql in Windows 7.
 

Click Mysql installer to automatically install Mysql. During this period, you can select the installation directory of the Mysql database as needed.

Note: after installing the Mysql database, you need to configure the Mysql database before using PHP for connection. how to configure it will be mentioned later.

Step 3: install PHP on Windows 7.

In fact, it is very simple to install PHP in Windows 7, because my PHP code package, as long as you extract the php-5.3.2-Win32-VC6-x86 and rename the folder php, copy it to the C directory to complete the PHP installation.

Step 4: configure the PHP environment in Windows 7.

The configuration of the PHP environment on Windows 7 is much simpler than that on Windows XP, and does not need to be copied. rename the ini-development configuration file to php. ini configuration file. Perform the following Configuration:

1. Open the php. ini configuration file and find 1
2; On windows:
; Extension_dir = "ext"


Change to 1
2; On windows:
Extension_dir = "C:/php/ext"


Specifies the directory of the PHP extension package to call the corresponding DLL file.

2. Because the default PHP does not support automatic Mysql connection, you need to enable the corresponding extended library function, such as php_mysql.dll, which is about 1
2
3
4
5
6
7 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


Remove the semicolon (;) before these extension.

3. Configure the PHP Session Function

When using the session function, we must configure the session file storage directory on the server. Otherwise, the session cannot be used. We need to create a new read/write directory folder on Windows 7, this directory is better independent from the main program directory of the WEB. Here I have created the phpsessiontmp directory on the root directory of the d disk, and then in php. 1; session. save_path = "/tmp"


Change to 1 session. save_path = "D:/phpsessiontmp"


4. How to compile the PHP file upload function when configuring the PHP file upload function?

Like session, when using the PHP file upload function, we must specify a temporary folder to complete the file upload function. Otherwise, the file upload function will fail, we still need to create a read/write directory folder on Windows 7. Here I have created the phpfileuploadtmp directory on the root directory of drive D, and then in php. 1 In the ini configuration file; upload_tmp_dir =


Change to 1 upload_tmp_dir = "D:/phpfileuploadtmp"


5. Modify date. timezone. Otherwise, an error will be reported in date when phpinfo is executed:

Warning: phpinfo () [function. phpinfo]…

We need to set 1; date. timezone =


Change to 1 date. timezone = Asia/Shanghai


You can also click for Reference

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.