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
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
Change
1
|
Date. timezone = Asia/Shanghai |
You can also click for reference