Configure the PHP environment on Windows 7

Source: Internet
Author: User
Step 4 of setting up the PHP environment in Windows 7: 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 require replication or other operations. you only need to configure the php environment in PHP. ini-Windows 7.

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

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 connection to Mysql, you need to enable the corresponding extended library functions, such as php_mysql.dll.

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. in the ini configuration file, find

1
; Session. save_path = "/tmp"

Change

1
Session. save_path = "D:/phpsessiontmp"

4. configure the PHP file upload function? How to compile 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. in the ini configuration file, find

1
; Upload_tmp_dir =

Change

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

1
; Date. timezone =

Change

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.