PHP Learning notes IIS7 installation configuration PHP environment _php tips

Source: Internet
Author: User
Tags configuration php install php php file upload vc9
How to install PHP

the choice of PHP version

There are two versions of PHP (php5.4.7) under Windows:

VC9 x86 Non thread safe non-threaded security run in fastcgi mode
VC9 x86 thread safe threads security running in ISAPI mode

installation Process

Just unpack the previous ZIP package and configure php.ini for details of how PHP is configured

how MySQL installs

Download the MySQL database MSI installation file and install the prompts next.

How PHP Configures

After extracting the zip package from PHP, locate the Php.ini-production file in the root directory and rename the file to PHP.ini
Open the php.ini configuration file,
Will
; On Windows:
; Extension_dir = "ext"
Amended to
; On Windows:
Extension_dir = "C:/php/ext"
Use to specify a specific directory for the PHP expansion pack to invoke the corresponding DLL file.

Because the default PHP does not support automatic connection to MySQL, you need to open the appropriate extension library features, such as Php_mysql.dll, will
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
Note: Extension=php_mysql.dll may default to if no changes are made, extension=msql.dll if not changed, the MySQL module will be prompted not to support
Remove these extension before the semicolon (;) removed.
Configure the session function for PHP
When using the session feature, we have to configure the Save directory on the server, or we will not be able to use session, we need to create a new read-write directory folder on Windows 7, which is best isolated from the Web main program directory. Here I set up the Phpsessiontmp directory on the D-Packing directory, and then in the php.ini configuration file
Will
; Session.save_path = "/tmp"
Amended to
Session.save_path = "D:/phpsessiontmp"

Configure the PHP file upload function?
As with the session, when using PHP file Upload function, we have to 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 set up the Phpfileuploadtmp directory on the D-Packing directory, and then in the php.ini configuration file
Will
; Upload_tmp_dir =
Amended to
Upload_tmp_dir = "D:/phpfileuploadtmp"

Modify the Date.timezone, otherwise the date section will complain when the phpinfo is executed:
Will
;d Ate.timezone =
Amended to
Date.timezone = Asia/shanghai, Shanghai
Date.timezone = Asia/urumqi; Urumqi, Beijing

Verify that PHP is configured successfully

Only need to double-click Php.exe in the PHP installation directory, if there is a problem, in the CMD interface can see the system prompted what problems.

Install fastcgi under IIS7 (Window Server 2008 R2)

1 Open the Control Panel and click on "Turn on or off Windows features"

2 Select Add role service at the roles node.

3 Select "CGI" under "Application Development" and click Install. After that, you can restart IIS.

Deploy PHP sites                                                                                                

1) to create a new site under IIS.

2) then select this web site, open the handler mappings

3) Click "Add Module Map"

4) Configure the request path to: *.php

Module selection: Fastcgimodule

Executable file: Select Php-cgi.exe in the php extract file

Finally browse the Web site

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.