Windows System Services Optimization Terminator installs PHP run Environment Text tutorial on Windows system

Source: Internet
Author: User
Tags http authentication mysql in php server php mysql php mysql extension php template mysql command line windows server versions
I. Download related software
Software Download Address
Httpd-2.2.15-win32-x86-no_ssl.msi http://httpd.apache.org/download.cgi
Mysql-5.1.46-win32.msi http://dev.mysql.com/downloads/
Php-5.2.13-win32.zip http://www.php.net/downloads.php
Phpmyadmin-3.3.3-all-languages.zip http://www.phpmyadmin.net/home_page/downloads.php
Zendoptimizer-3.3.3-windows-i386.exe http://www.zend.com/en/downloads/
Create a folder named Lamp on the Windows system's C drive, as the installation location for the Web environment, and install all the required software for the environment under this folder.
Two. Installing Apache
1 The Set System Information dialog box requires you to enter several basic configuration parameters. These three information can be arbitrarily filled out, invalid also line.
Enter the "lampbrother.net" domain name in the first input box.
Add a www.lampbrother.net server name to the second input box.
The third one to add is the contact email address, which is provided to the visitor when the system fails.
is the e-mail address of this Web server administrator, enter lampteacher@gmail.com here.
Finally, select the port of the Web server, use the default port of 80, and start automatically as a system service (the first item).
2 Pop-up Select the Installation Type dialog box, "Typical" is the default installation, "Custom" for user-defined installation, we choose "typical" type here.
3 Select the Install Location dialog box to set the Apache installation location to "D:\lamp\apache2".
4 The Confirm Installation dialog box pops up. If you need to check again, you can click 5 Pop-up is installing the interface, the installation Wizard completed successfully, the lower right corner of the status bar should appear the Apache Green Small Icon management tool, indicating that the Apache service has started to run
6 Apache After the installation is complete, its installation directory is specified under "C:\lamp\apache2".
The Apache configuration file is the "C:\lamp\apache2\conf\httpd.conf" file,
The place where Apache stores Web pages is the "C:\lamp\apache2\htdocs" folder.
7 There are several ways to start and stop Apache in a Windows system, as the following examples do.
Click Start menu, All Programs->apache HTTP server 2.2->control Apache server under Stop Stop, start on, or restart restart.
Click My Computer, services and applications, services->apache2.2 options, click Stop, open, or restart.
Open, stop, or restart the Apache server by using the Apache Green Small Icon Management tool on the status bar in the lower right corner of the Windows system.
8 Apache If the boot succeeds, it can be tested by the browser. Open the browser and enter the http://localhost/URL in the address bar,
You can see IT works! This indicates that the Apache installation was successful and could be used.
Three. Install MySQL
Installing the MySQL database server can be divided into two parts:
Part of the installation of the program, and the other part is to use the MySQL configuration Assistant to create a MySQL configuration file, some detailed configuration options, and to the MySQL server to set a password and other content.
The MySQL configuration assistant runs automatically after the first part of the installation is finished, or it can be started manually after the MySQL installation is complete.
1 Install the "mysql-5.1.46-win32.msi" file.
2 Pop-up installation Type selection dialog with three options, typical installation (typical), full installation (complete), and user-defined (custom) three types.
Choose "Custom" here to get more options to make it easier for us to specify the installation location. Click the "next>" button to proceed to the next installation.
3 The user-defined Settings page pops up and the "Developer components" option is left-click,
Then select the second item "This feature, and all subfeatures, will is installed on the local hard drive.",
That is, "This section, and sub-sections of subordinate content, all installed on the local hard disk."
4 Specify the installation location. Click the "Change ..." button to alter the installation location and assign it to the "C:\LAMP\MYSQL5" folder.
Not only does this option change the installation location, the previous options include the MySQL server option (MySQL servers),
The MySQL client program option (the client Programs), the file option (documentation), change the installation location, the operation is the same.
Click the "Change ..." button, manually changing the installation location, you can point the installation location of the several options to the "C:\LAMP\MYSQL5" folder.
The recommended server data file "MySQL server datafiles" option is not specified under the same partition as the operating system. This prevents the data from being emptied when the system backup is restored.
This is assigned to the D:\datafiles\ folder. Click the next> button after the setup is complete to proceed to the next installation.
5 The Installation Location confirmation dialog box pops up and waits a few seconds for the installation to take place. Here the MySQL database software is installed, the interface appears,
Tick "Configure the MySQL Server now", click the "Finish" button to end the installation of the software and start the MySQL Configuration Wizard.
6 then run the MySQL configuration Assistant automatically, to the second part of the installation MySQL configuration phase.
7 Popup Configuration Type selection dialog box, there are two options detailed configuration (detailed configuration) and standard configuration. Select the first item "detailed Configuration".
Some of the content that the MySQL configuration assistant needs to set up in the next few steps is when you select this item. After selecting the type, click the Next> button to continue with the next configuration.
The 8 Popup Server Type selection dialog box determines how much main memory the MySQL server will attempt to retain. The larger the main memory, the faster the server will be, but the greater the impact on other programs.
Here are three options:
Developer machine option is to develop test class, MySQL occupies very little resources;
Server machine option is the type of servers, MySQL occupies more resources;
The dedicated MySQL server machine option is dedicated to the database server, and MySQL occupies all available resources.
The first developer option is the best choice for Web developers, and the other two are best for large databases. After selecting the type, click the Next> button to continue with the next configuration.
9 The Database Usage dialog box pops up. They determine what kinds of data table types the MySQL server will support.
There are also three options:
The "Multifunctional Database" option is a versatile, better type, which is the default selection type;
The "Transactional Database only" option is a server type that focuses on transaction processing;
"Non-transactional Database only" option is non-transactional, relatively simple, mainly to do some monitoring, counting.
The user can change depending on the purpose of the actual database, we use the default selection here, click the "next>" button to continue the next configuration.
10 The InnoDB table space setting (InnoDB tablespace Setting) dialog box appears, where you should specify a storage location for the InnoDB database file. The default storage location is the MySQL installation directory,
Here, using the default storage location, click the "next>" button to continue with the next configuration.
11 pop-Up concurrent connection (Concurrent Connections) Selection dialog box, where the options determine the number of simultaneous open database connections.
A total of three options:
The first "decision Support (DSS)/olap" option can have 20 connections;
The second Online Transaction processing (OLTP) option can have 500 connections;
The third "Manual Setting" option sets a number of connections manually.
For a MySQL server running on a computer for software development, there is no need for too many connections, so it should be fine to choose the first "decision Support (DSS)/olap".
However, the number of concurrent connections can be very large for MySQL servers that are working at full speed on some popular sites, so you should choose the second Online Transaction processing (OLTP) option.
Here, using the default first option, click the "next>" button to continue with the next configuration.
12 Popup Activates the TCP/IP networking feature (Enable TCP/IP Networking) dialog box. In a Windows system environment, the MySQL server communicates with the application in two ways:
One is through named pipes (named pipe);
The second is TCP/IP via network protocol.
The recommended configuration for the MySQL configuration Assistant is to activate TCP/IP and use port No. 3306. Select the Multi box (join firewall does not block this port) and use the default recommended configuration. Click the Next> button to continue with the next configuration.
13 The default Character Set dialog box pops up, and when you save the text data to the database, MySQL supports the various existing character sets.
Here we choose the third item, in order to better handle the Chinese character set, select or fill in "UTF8" in character set, click "Next>" button to continue the next configuration.
14 Pop-up installs as Windows services (install as Windows Service) dialog box. Here you can choose whether to install the MySQL service as a Windows system service,
This allows the MySQL server to be managed through Windows System Services management. You can also specify the service name (the Services identity name).
Another option is to choose whether to add the MySQL bin directory to Windows path (after joining, you can use the file directly in the bin directory without pointing out the directory name). (Please select)
Here, accept the default settings recommended by the MySQL configuration assistant, and click the "Next>" button to continue with the next configuration.
15 The Security Options dialog box pops up. This is the most important configuration and you need to decide which people are allowed to connect to the MySQL server and whether you must enter a password to establish the connection.
Set to the most secure setting, because root is the only user who is the user of the MySQL system administrator, you should let the root user enter the password correctly to connect to the database and only allow him to log on locally.
Do not tick the second option, where no anonymous account is created, so-called anonymous accounts refer to accounts that can connect to the database without a password. Click the Next> button to continue with the next configuration.
16 The Confirmation Execution dialog box pops up. Verify that the configuration settings you made are correct, and if you are wrong, click After the installation and configuration of the above steps, the MySQL installation directory is "C:\lamp\mysql5\" under the MySQL install environment.
The MySQL configuration file is the "C:\lamp\mysql5\my.ini" file, where the MySQL data file is stored in the "D:\datafiles\data" folder.
Windows system to start and stop MySQL, right-click on My Computer---services and applications----services and apps--->mysql option, clicking Stop, open or restart.
19 Test MySQL Database installation is successful, you can open a MySQL client to log on to the MySQL server for testing.
Use the Start menu, All Programs->mysql->mysql Server 5.1->mysql command line client to start the MySQL Shell Mysql.exe,
Then enter the password you entered when configuring MySQL. If all goes well, you should see the input prompt for MySQL in the input window. Next, the status command is executed and the result indicates that the MySQL server was successfully installed.
Solution:
Problems when installing MySQL and how to fix it: When installing MySQL, the system prompts: cannot create Windows service for mysql.error:0
The reason is that the old MySQL service exists in the system, the solution is as follows:
To permanently delete the old MySQL service, the user is required to execute the following command on the command line with administrative privileges:
C:\>SC Delete MySQL
[SC] DeleteService SUCCESS
When installing the service, if there is a similar situation, look at the service is not a legacy service program, workaround, delete the old service, install the new service.
Three. Install PHP
When installing a PHP server, two tasks must be completed.
PHP is a module of the Apache server, to plug into the Apache to assist it to process PHP files, so the first task is to download PHP module in Apache.
At development time also to use the PHP program to connect to the database and operation of the database, so the second task is to configure the PHP MySQL extension interface.
(1) Install PHP as an extension module for the Apache server.
Step one: "Php-5.2.13-win32.zip" of the file. Unzip the contents of this zip document into one of the selected subdirectories, and we'll unzip it into the "C:\LAMP\PHP5" directory.
Step two: Load PHP into Apache in the form of a module.
The way to load is to write three lines of content in the Apache config file httpd.conf: The first line loads the PHP module;
The second line tells the Apache server that the suffix name is. php or specify a different suffix name for the file using PHP parsing; the third line specifies the location of the PHP configuration file.
Here we insert the following three lines into a location in the Apache configuration file C:\lamp\apache2\conf\httpd.conf.
LoadModule php5_module "C:/lamp/php5/php5apache2_2.dll" #加载PHP模块
AddType application/x-httpd-php. php. phtml #PHP模块解析哪种后缀文件
Phpinidir "C:/LAMP/PHP5" #指定PHP配置文件的位置
Attention:
The first line is to load PHP 5 as a module, inserting this line into the Apache configuration file httpd.conf "#LoadModule vhost_alias_module modules/mod_vhost_alias.so" Line below. Where C:/lamp/php5/php5apache2_2.dll is the file under the appropriate path to install PHP. Be careful not to confuse Php5apache2_2.dll, Php5apache2.dll, and Php5apache.dll, Php5apache.dll only for versions prior to Apache 2.0, PHP The Php5apache2.dll in the 5 compression package is only available for the apache2.0.* version, and if it is 2.2.* or later, Php5apache2_2.dll must be used. Otherwise, there may be some loading errors.
The second line is to add support for PHP. Tell Apache which suffixes to parse as PHP. For example, let Apache parse the. php or. phtml suffix file into PHP. Locate the "AddType application/x-gzip. gz. tgz" Item in the Apache configuration file and add the "AddType application/x-httpd-php. php. phtml" line below it. Any suffix file can be parsed into PHP, as long as the added statement and separated by a space, here to add more than one. Phtml to the example.
The third line, which specifies the location of the PHP configuration file php.ini, is added under "AddType application/x-httpd-php. php. phtml" On the second line, where "C:/LAMP/PHP5" Specifies the directory of the previously selected PHP decompression.
Step three: Build the PHP configuration file. Directly to the PHP decompression directory c:/lamp/php5 The following php.ini-recommended file renamed to PHP.ini.
You can also rename the file Php.ini-dist in the C:/LAMP/PHP5 directory to php.ini, but the profile automatically adds "//" to all additions, adding security and adding to the hassle If you rename php.ini-recommended to PHP.ini, the profile does not add "//" to the added content, which reduces security, but is more convenient. This is the name php.ini-recommended file to be renamed as php.ini file.
Step four: Restart the Apache server. The Apache server should be restarted as long as the Apache configuration file httpd.conf or the PHP configuration file php.ini have been changed. The Apache server loads the configuration file httpd.conf at boot time, making the contents of the configuration file change effective.
PHP as a working module of the Apache server, but also when the Apache boot load configuration file php.ini make the changes take effect.
Step five: Test whether the PHP installation was successful. The above steps have installed PHP as an extension module for Apache and started with the Apache server.
If you want to check if PHP is installed successfully, you can use a text editor to create a file named Test.php, under the C:\lamp\apache2\htdocs folder where the Apache server holds the Web page.
Phpinfo ();//php internal function for printing PHP state information
?>//php Script end tag
Then use your Web browser to open the http://localhost/test.php page. A PHP test page appears stating that the PHP installation was successful.
(2) Configure MySQL extension interface for PHP
Step one: After the above configuration, PHP5 has been installed successfully. But PHP is not yet able to access the MySQL database server, so PHP must find the two MySQL-related DLL files installed with PHP.
Before this, you should first copy the Libmysql.dll file under PHP installation directory C:\lamp\php5\ to the Windows installation directory.
This directory is typically C:\Windows, and some Windows server versions are C:\WINNT directories. You can also set the environment variables of the Windows system and add the PHP decompression directory C:\lamp\php5\ to the PATH environment variable.
Here we copy the C:\lamp\php5\libmysql.dll file to C:\Windows below.
Step two: Turn on the MySQL feature in the PHP configuration file. Use a text editor to open the PHP configuration file C:\lamp\php5\php.ini.
The MySQL and mysqli extension interfaces can be opened by inserting the following three items. You can also find the following three lines in the PHP configuration file, removing the semicolon that was used for the comment earlier.
Extensi #指定PHP的扩展接口目录, the directory delimiter is "/"
Extension=php_mysql.dll #开启MySQL扩展接口
Extension=php_mysqli.dll #开启MySQLi扩展接口
Step three: Restart the Apache server and the changes made using the PHP configuration file take effect.
Step four: Check the contents of the PHP test page to see if there is a description of the MySQL and mysqli interface parameters. If you see 2-46 displayed information indicating that PHP's MySQL and mysqli extension interfaces were loaded successfully, also open a Web browser to access the http://localhost/test.php page for testing.
After the above configuration, we have completed the configuration of PHP MySQL and mysqli extension interface, if need to configure other extension interface is the same method.
4. Installing the Zend Accelerator
Step one: "Zendoptimizer-3.3.3-windows-i386.exe" of the file. This is a direct installation file, double-click to start the installation program.
Step two: Through the installation of the previous step appears the following interface, confirm consent to the Software Installation license regulations, select "I accept the terms in the License Agreement", click the "next>" button to continue.
Step three: Pop up the Select Installation Location dialog box, where you can choose your preferred location, we will Zend Optimizer installation location set to "C:\lamp\ZendOptimizer\", click the "next>" button to continue the installation.
Step four: Pop up the following screen to select the type of Web server, select the apache2.x option. Click the Next> button to continue the installation.
Step five: Pop-up Select php Config file php.ini Location dialog box. When we install PHP, we assign php.ini to the installation directory of PHP C:\lamp\php5\ below, so the location chosen here is also the C:\LAMP\PHP5 folder.
Step six: Pop up the following dialog box to select the root directory of the Web site, select the root path of the site content. When we installed Apache, we assigned the site root directory to the Apache installation directory C:\lamp\apache2\,
So the location selected here is also the C:\lamp\apache2\ folder, click the "next>" button to continue the installation.
Step Seven: Pop Up the Confirm Installation dialog box. If you need to check again, you can click Step eight: If the following prompt pops up, close the Web server first, and then click OK to proceed with the installation.
Step nine: If everything installs smoothly the following End installation dialog pops up, click the "Finish" button to end the installation, and the installation is complete.
Step Ten: Check the installation results. Start the Apache server, open a Web browser to access the Http://localhost/test.php page, and test through the phpinfo () function. If the following appears, the installation is successful.
Makes use of the Zend Scripting Language Engine:
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
With Zend Extension Manager v1.2.0, Copyright (c) 2003-2007, by Zend Technologies
With Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies
Installation of 5.phpMyAdmin
Step One: Extract Phpmyadmin-3.3.3-all-languages.zip to/apache2/htdocs/, and create a folder called phpMyAdmin, put the compressed files into the installation is completed.
Step Two: Configure the phpMyAdmin top-level directory config.inc.php, the default does not exist config.inc.php files, we need to create one manually, you can also copy the config.sample.inc.php template to get the minimum configuration file.
The following example configures the config.inc.php file with only the parts that must be modified, and depending on the actual situation, some other options may be required to make changes.
We can use the authentication mode requirements, there are two configuration scenarios, one is the HTTP and cookie authentication mode.
In both modes, the user must first enter a valid user name and password for the MySQL database in a login window to use the phpMyAdmin program.
This approach has two obvious benefits: first, because the MySQL database password does not appear in the config.inc.php file, so the authentication process is more secure;
Second, it allows you to manage your own database by logging in as a different user. These two authentication modes are especially suitable for multiple user accounts in a database.
The second scenario is the Config authentication mode. In this mode, the password is stored in clear text in the config.inc.php file. Just write the MySQL user name and password directly to the config.inc.php file.
This way, you will not be prompted to enter a user name and password when you log in to phpMyAdmin, only the user who is written in the config.inc.php file is logged in directly.
You can use this mode if you are using phpMyAdmin only on a local test system.
(1) HTTP Authentication Mode
If you want phpMyAdmin to use the HTTP authentication mode, you first need to make the following changes in the config.inc.php file, as shown in the Bold section. The specific contents are as follows:
$cfg [' Servers '] [$i] [' auth_type '] = ' http '; Only modify this line to the HTTP authentication mode
When we have finished setting up, when we launch phpMyAdmin, a Web Browser dialog box will pop up, and we need to enter the MySQL username and password in this dialog box to enter the phpMyAdmin interface. The Windows client uses Internet Explorer to access the index.php file under the phpMyAdmin directory of the Web server, which launches the phpMyAdmin.
(2) Cookie authentication mode
The cookie Authentication mode complements the HTTP authentication mode and can be used in situations where HTTP authentication mode cannot be used. The cookie authentication mode requires that the user must allow cookies from phpMyAdmin to enter their own computer. That is, the user needs to turn on the client's cookie function in the browser.
If you want phpMyAdmin to use cookie authentication mode, you must also provide a string to the Blowfish_secret parameter in addition to the AUTH_TYPE statement in the config.inc.php file. This string can be arbitrary in order to encrypt the user and password used at login before the cookie is stored on the client computer. The contents of the changes in config.inc.php are as follows:
$cfg [' blowfish_secret '] = ' xxxxxxx '; You need an arbitrary string here.
$cfg [' Servers '] [$i] [' auth_type '] = ' cookie '; This changes to Cookie authentication mode
As in the way it starts phpmyadmin, we use Internet Explorer in Windows clients to access the index.php file under the phpMyAdmin directory on the Web server and need to provide MySQL username and password to log in.
(3) Config authentication mode
If you want phpMyAdmin to use the Config authentication mode, you first need to make the following changes in the config.inc.php file. The MySQL database user name and password are written in clear text, the specific changes are as follows:
$cfg [' Servers '] [$i] [' auth_type '] = ' config '; This changes to config authentication mode
$cfg [' Servers '] [$i] [' user '] = ' root '; Use the username of your MySQL database
$cfg [' Servers '] [$i] [' password '] = ' 111111 '; Use the password of your MySQL database
As in the way it started phpMyAdmin, we used the Windows client to access the index.php file under the phpMyAdmin directory on the Web server using Internet Explorer. Instead of providing a MySQL username and password to log in, it is logged in with the user name and password written in clear text in config.inc.php.
Note: phpMyAdmin to lowercase

The above describes the Windows System service optimization terminator installed on Windows system PHP Run Environment text tutorial, including the Windows System service optimization terminator aspects, I hope to be interested in PHP tutorial friends helpful.

  • Related Article

    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.