Tutorial on setting up the PHP runtime environment of the Discuz forum on the WindowsVPS server

Source: Internet
Author: User
Tags website ip
I. The system agrees that the Environment software should be downloaded and stored at: X: \ Server_Tools environment software installation location: X: \ Server_CorePHP installation location: X: \ Server_Core \ PHPMySQL installation location: X: \ Server_Core \ MySQLZendOptimizer installation location: X: \ Server_Core \ ZendIIS website root directory:

I. system conventions

Location of environment software downloaded: X: \ Server_Tools

Environment software installation path: X: \ Server_Core

PHP Installation Path: X: \ Server_Core \ PHP

MySQL installation path: X: \ Server_Core \ MySQL

Zend Optimizer installation path: X: \ Server_Core \ Zend

IIS website root directory: X: \ wwwroot

MySQL Database location: X: \ Database

Php. ini storage location: X: \ Windows \ php. ini

My. ini storage location: X: \ Server_Core \ MySQL \ my. ini

2. check the system environment and prepare required software

1. check whether IIS is installed.

Click "start"-"administrative tools" to check whether "Internet Information Service (IIS) Manager" exists"

2. view the disk partition capacity and determine the usage policy

Open "My Computer" and check the available space capacity of each disk partition except for Area C. Use a large disk partition as the WEB root directory, and use the MySQL Database storage directory (Database ), try not to be in the same disk partition as the WEB root directory. A small disk partition can be used as the installation directory partition of the service environment software.

3. download environment software

Download and store all the software in the Server_Tools folder.

MySQL-essential-5.0.45-win32.msi

Php-5.2.4-Win32.zip

ZendOptimizer-3.3.0-Windows-i386.exe

III. environment deployment

1. install MySQL

(1) install software

Go to the X: \ Server_Tools folder and double-click the MySQL-essential-5.0.45-win32.msi, as shown in:

WindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "title =" please explainWindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "id =" image_operate_49341308810232260 "/>

Select M Custom installation, as shown in:

WindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "title =" please explainWindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "id =" image_operate_15921308810278634 "/>

Click "Change" to Change the MySQL installation directory, as shown in:

WindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "title =" please explainWindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "id =" image_operate_84561308810323357 "/>

After the file is copied and installed, go to the MySQL settings page and click Finish. As shown in:

WindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "title =" please explainWindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "id =" image_operate_49771308810361896 "/>

Select Detailed Configuration for Detailed Configuration, as shown in:

WindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "title =" please explainWindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "id =" image_operate_15651308810406694 "/>

Select MySQL running mode: as shown in the following figure:

WindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "title =" please explainWindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "id =" image_operate_76741308810967691 "/>

Select the default MySQL database storage method: Non-Trans Only (MYISAM), as shown in:

WindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "title =" please explainWindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "id =" image_operate_12931308810531461 "/>

Set the maximum number of MySQL connections: generally set to an integer between 128 and 512. As shown in:

WindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "title =" please explainWindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "id =" image_operate_20171308810584841 "/>

Set MySQL Network Parameters. note: do not enable Strict Mode! As shown in:

WindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "title =" please explainWindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "id =" image_operate_12871308810623495 "/>

Set the default MySQL character set: the user site language prevails. As shown in:

WindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "title =" please explainWindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "id =" image_operate_55261308810679873 "/>

Windows environment settings, as shown in:

WindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "title =" please explainWindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "id =" image_operate_57871308810779951 "/>

Change the password of the root user. note: Do not start the remote connection mode! As shown in:

WindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "title =" please explainWindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "id =" image_operate_86991308810980906 "/>

Install MySQL and start the MySQL service. As shown in:

WindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "title =" please explainWindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "id =" image_operate_66861308812162628 "/>

(2) test whether MySQL works properly.

Open the cmd command prompt window and enter the command: MySQL? U root? P

After you enter the password, if you can access the MySQL console, the MySQL installation is normal.

(3) change the MySQL database Directory

A) open the cmd command prompt window and enter the command: net stop MySQL to stop the MySQL service;

B) open X: \ Server_Core \ MySQL \ my. ini.

Find:

Datadir = "X: \ Server_Core \ MySQL \ data"

To:

Datadir = "X: \ Database"

C) copy the X: \ Server_Core \ MySQL \ data folder to X: \ and rename it to X: \ Database;

D) open the cmd command prompt window and enter the command: net start MySQL to start the MySQL service.

E) re-test whether MySQL works normally.

(4) prepare LibMySQL dynamic link library

Copy the X: \ Server_Core \ MySQL \ bin \ libMySQL. dll file to C: \ Windows \ System32.

2. install PHP

(1) decompress the downloaded php-5.2.4-Win32.zip file and copy it to: X: \ Server_Core \ PHP;

(2) go to the X: \ Server_Core \ PHP folder and rename php. ini-dist to php. ini;

(3) open the php. ini file and find: extension_dir = "./"

Change it;

Extension_dir = "X: \ Server_Core \ PHP \ ext"

(4) Find Windows Extensions.

In the dynamic module configuration under Windows Extensions, you need to enable the following module support: (remove the number before each line of the module configuration)

Extension = php_mbstring.dll

Extension = php_gd2.dll

Extension = php_MySQL.dll

(5) find:

Disable_functions =

Changed:

Disable_functions = phpinfo, passthru, exec, system, chroot, scandir, chgrp, chown, shell_exec, proc_open, commit, ini_alter, ini_alter, commit, dl, pfsockopen, openlog, syslog, readlink, symlink, popepassthru, stream_socket_server

(6) save the php. ini file and copy it to C: \ Windows \

3. IIS and PHP integration configuration-create a website

(1) start IIS Manager and create a new website (virtual host), as shown in:

WindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "title =" please explainWindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "id =" image_operate_44231308811201325 "/>

WindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "title =" please explainWindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "id =" image_operate_39281308811249754 "/>

(2) enter the website name. if the name is changed to the ID in IIS, enter the website name as needed. As shown in:

WindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "title =" please explainWindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "id =" image_operate_11851308811285342 "/>

(3) You do not need to enter the website IP address. if the port does not have special requirements, you can keep it at 80. finally, enter the website domain name correctly. As shown in:

WindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "title =" please explainWindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "id =" image_operate_26021308811310487 "/>

(4) Create wwwroot and bbs in the website partition. As shown in:

WindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "title =" please explainWindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "id =" image_operate_8335130881110840 "/>

(5) for PHP applications, you must grant the site the "read" and "Run script" permissions. As shown in:

WindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "title =" please explainWindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "id =" image_operate_27861308811516615 "/>

(6) a site has been created successfully. As shown in:

WindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "title =" please explainWindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "id =" image_operate_36201308811558687 "/>

4. integrated configuration of IIS and PHP-make the site support PHP

(1) open the website properties just created, as shown in:

WindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "title =" please explainWindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "id =" image_operate_54421308811622757 "/>

(2) in the site properties window, click the "main directory" tab and click "configuration". in the displayed "application configuration" dialog box, click "add, to support php isapi, select the executable file: X: \ Server_Core \ PHP \ php5isapi. dll, the extension is. php: GET and POST. Click "OK" to add and check whether the. php extension is successfully loaded in the "application configuration" window. If yes, click OK to close the configuration window and return to the main site properties window. As shown in:

WindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "title =" please explainWindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "id =" image_operate_67411308811823714 "/>

(3) click the "document" tab, add index.htm?index.html and index. php files to the default content document, and sort all default documents in sequence as shown in. Click OK to close the site property configuration window and return to the main interface of IIS Manager. As shown in:

WindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "title =" please explainWindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "id =" image_operate_30841308811859471 "/>

(4) right-click "Web service extension" to add PHP extension support. As shown in:

WindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "title =" please explainWindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "id =" image_operate_49541308812127441 "/>

(5) in the "new WEB service extension" dialog box shown in, enter PHP for the "extension" and select X: \ Server_Core \ PHP \ php5isapi for the "file. dll, and set this PHP extension to allow by default. As shown in:

WindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "title =" please explainWindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "id =" image_operate_50781308812114993 "/>

(6) restart the IIS service, as shown in:

WindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "title =" please explainWindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "id =" image_operate_97741308812067887 "/>

WindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "title =" please explainWindowsVps, server PHPRecommended tutorial for Discuz environment setupIllustration "/>

Test whether PHP support is normal

The integration of IIS and PHP has been completed. Next we need to test whether PHP support is normal.

(1) go to the X: \ wwwroot \ bbs \ directory and create a new phpinfo. php file with the following content:

 Phpinfo ();
 ?>

(2) open IE browser, enter: http://www.domain.com/phpinfo.php;

(3) If the PHP support information is displayed normally, the configuration integration is successful.

6. install Zend Optimizer

Go to the X: \ Server_Tools folder and double-click the zendoptimizer-3.2.6-windows-i386.exe file. the installation process is very friendly and simple, so it is not described here. Note the following:

(1) the installation directory of Zend Optimzer must be specified as X: \ Server_Core \ Zend;

(2) when installing php. ini, check whether it is C: \ Windows. if not, manually specify it as C: \ Windows;

(3) during the installation process, the location of the root directory of the IIS website is prompted, and the value is X: \ wwwroot.

After Zend Optimizer is installed, the IIS service is automatically restarted. after restart, you need to open the IE browser window again to view phpinfo. php support information. check whether Zend Optimizer support information is included. if not, it indicates that ZendOptimizer has not been installed successfully!

Finally, modify the php. ini file and add the phpinfo function to disable_functions.

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.