Testlink Learning One: Windows Build apache+mysql+php Environment

Source: Internet
Author: User
Tags install php php development environment php website vc9 apache log root access testlink fully qualified domain name

There are many PHP integrated development environments, such as XAMPP, Appserv ... Just one click to install the PHP environment to build. But this kind of installation method is not flexible, the free combination of software is inconvenient, but also not conducive to learning. So I still like to build PHP development environment manually, which module needs to be installed on the line, or the software needs to upgrade, directly upgrade the software on the line, does not affect the other software, very convenient.

installation Environment : WindowsXP 32

First, preparation-download the required software

    • Apache Httpd-2.2.22-win32-x86-openssl-0.9.8t.msi
    • PHP Php-5.3.10-win32-vc9-x86.zip
    • MySQL Mysql-5.5.28-win32.zip

(Download PHP website: http://tool.php100.com/)

Second, install the software

1. Installing Apache

Note: The default for Apache servers is port 80

Double-click installation is no different from installing other Windows software, there is no special requirement when filling in server infomation, as long as the information entered conforms to the format.

Server information can be configured by default, if the server's 80 port is not occupied by other server programs. Optional "For all Users,on Port, as a service-recommended." If you are only using 8080 ports for the current user, manually start, select the "only for the present user, on port 8080, when started manually." The port number can be modified through a configuration file.

Apache Service Manager appears after installation, for example, click the first icon

(Note: This service is not started after Apache has been installed )

The service management list has a service item that can now be started, click "Start"

In the browser input http://localhost, if the IT works! is displayed, the Apache installation is successful.

2. Install PHP

Unzip the php-5.3.10-win32-vc9-x86.zip to a directory, and in this case I put it under the D:\php folder.

3. Install MySQL

Double-click Install, if you need to change the installation directory, select Custom in the Choose Setup Type

Select User Custom Configuration here

You can change the installation directory location for MySQL, which remains the default here.

When done, tick "Launch the MySQL instance configuration Wizard" to configure MySQL.

After the installation is complete, configure MySQL to all the default options, but it is best to change the default MySQL encoding to UTF8, set the password in the Modify Security settings option, enter the password two times, and finish the configuration with the last execute.

Select configuration mode: "Detailed configuration (manual and precise configuration)", "Standard Configuration", select "Detailed Configuration",

Select the server type, "Developer Machine (Development test class, MySQL occupies very little resources)", "Server machine (server type, MySQL takes up more resources)", "dedicated MySQL server Machine (dedicated database server, MySQL occupies all available resources) ", General Select" Server machine ". Can be selected according to the actual situation. This example uses the development test type drop.

Choose the general purpose of MySQL database, "Multifunctional database (Universal multifunction, good)", "Transactional database only (server type, focus on transaction processing, general)", " Non-transactional Database only (non-transactional, simpler, mainly to do some monitoring, counting, support for MYSAM data types is limited to non-transactional) ", select" Transactional Database only ", this example selects the Universal multifunction type.

To InnoDB tablespace configuration, is to select a storage space for InnoDB database files, if modified, to remember the location, re-install the time to choose the same place, otherwise it may cause database corruption, of course, do a backup of the database is no problem. Use the default location.

Select half of the MySQL traffic for the site, number of simultaneous connections, "decision Support (DSS)/olap (20 or so)", "Online Transaction Processing (OLTP) (around 500)", "Manual Setting (manually set, lose a number yourself), select Online Transaction processing (OLTP). This example selects the first item, because only in this machine to do development testing work.

Whether to enable TCP/IP connection, set the port, if not enabled, you can only access the MySQL database on your own machine, select "Enable TCP/IP Networking" to enable TCP/IP connection, set the port, if not enabled, You can only access the MySQL database on your own machine and select "Enable TCP/IP Networking".

Set the database language encoding, "standard Character set" is a Latin code, "best support for Multilingualism" is RTF-8 encoded, "Manual Selected Default Character Set/collation "To manually set the encoding, UTF8

Install as Windows service selects the MySQL service to customize the name of the service.

"Include Bin Directory in Windows PATH" is an environment variable that adds MySQL to the machine.

Select "Modify Security Settings" To check the "Enable root access from remote machines" according to the actual requirements so that it can be accessed from other machines.

After the configuration is complete, click "Execute" to execute the configuration.

The MySQL installation is complete.

To test whether the MySQL installation was successful:

Iii. Integration of Apache+php+mysql

Apache : First modify the Apache configuration file, let Apache support parsing php files. Apache configuration files are httpd.conf in the Conf directory of the Apache installation directory .

1. Allow Apache to parse the PHP file and locate it in the configuration file

#LoadModule Vhost_alias_module modules/mod_vhost_alias.so

Add on the next line (the Green location is based on the directory where PHP is located)

LoadModule php5_module "d:/php/php5apache2_2.dll"
Phpinidir "d:/php"
AddType application/x-httpd-php. php. html. htm

2. Found in the configuration file

DirectoryIndex index.html

Switch

DirectoryIndex index.php index.html

3. Modify the Apache Site Directory, found in the configuration file (Apache installed directory, different values displayed)

#DocumentRoot "C:/Program Files/apache software Foundation/apache2.2/htdocs"

Switch

  DocumentRoot "d:/php"

Find it again.

  #<directory "C:/Program Files/apache software Foundation/apache2.2/htdocs" >

Switch

 <directory "d:/php" >  

PHP : Renamed Php.ini-development to php.ini as a PHP configuration file. Modify PHP.ini

1. Set the specific directory for the PHP expansion pack to find

; On Windows:
; Extension_dir = "ext"

Change to (value is the directory of Ext folder)

; On Windows:
Extension_dir = "d:/php/ext"

2. Turn on the library function to locate the row of the library you want to open

; Extension=php_curl.dll

; Extension=php_gd2.dll

; Extension=php_mbstring.dll

; Extension=php_mysql.dll

; Extension=php_xmlrpc.dll

Remove the preceding semicolon (note) and change to

Extension=php_curl.dll

Extension=php_gd2.dll

Extension=php_mbstring.dll

Extension=php_mysql.dll

Extension=php_xmlrpc.dll

      

3. Set the time zone to find

;d Ate.timezone =

Switch

Date.timezone = Asia/shanghai

Iv. Verifying the success of the installation

Configuration is complete to detect the success of the configuration. There are two ways to verify.

The first type: Restart Apache, create a new file index.php in the Site directory, enter the content:

<php    phpinfo ();? > 

Open the browser input http://localhost, display the following content, the installation was successful, and successfully associated with MySQL.

The second type: the content of the testdb.php file is established under the Web root directory (e.g. D:\website) as follows:

<? PHP   $link =mysql_connect (' localhost ', ' root ', ' 123456 ');   if (!  echo "fail"echo "Success"mysql_close();?>        

Note Change the address of the connection database and the password for root.

Open http://localhost/testdb.php with a browser if the output success means PHP, MySQL and Apache are happy to work together.

Five, the installation process encountered problems

1. Enter http://localhost in the address bar to display the IIS page

Cause:IIS is the same as the Apache default port number

workaround one : Stop the IIS Service

Solution Two : Modify the Apache port number

2. Enter http://localhost in the address bar to prompt for domain name parsing errors

Cause: Apache After installation is not started

workaround : normal access after startup.

3. Start the Apache times wrong The requested operation has failed

reason one : 80 port occupancy
For example , IIS, the other is thunderbolt. My Apache server is not able to enable the Thunderbolt!

Windows platform to see who occupied our 80 port method: Execute:c:\>netstat-aon|findstr "TCP 127.0.0.1:80" under Windows command Line window         0.0.0.0:0               LISTENING       2448 See, Port is occupied by process number 2448 process, continue to execute the following command:c:\>tasklist|findstr "2448" Thread.exe                     2016 Console                 0     16,064 k very clear, thread takes up your port, kill it if the second step is not found, then open the Task Manager, see which process is 2448, and then kill it. If you need to see additional ports. You can get rid of 80  .

cause two : software conflicts
Installed some software will make Apache unable to boot such as dr.com you open the network connection->TCPIP Properties--Advanced->wins tab Remove NetBIOS Lmhosts, disable TCP/IP NetBIOS. And then start again should be ready.

reason three : httpd.conf configuration Error
If Apache configuration file httpd.conf wrong, start it in Windows, will prompt the requested operation has failed, this is more depressed thing, because the wrong to see a half day.
In fact, you can start Apache with command-line mode, and with parameters, Apache will prompt you which sentence is wrong, and then can be targeted to solve, the command is as follows: httpd.exe-w-N "Apache2"-K Start

There is another situation :
Even if you start this time, next time you're probably starting to fail.
Input in operation:netsh winsock reset
After a while CMD will prompt you to restart, regardless, now Apache is ready to start.
is actually a Winsock fix

4. If the Apache service item does not appear in your Apache Post installation service Management list, it indicates that an error occurred during the installation process and can be installed manually.

workaround : Use cmd to enter C:\Program Files\apache software foundation\apache2.2\bin This is my native installed directory and execute the httpd-k install command, After the prompt is successful, you can see the Apache service in the Service management list.

5, httpd.conf configuration, if the PHP directory without php5apache2_2.dll, it must be the wrong version of the download.

6, MySQL installation problems, need to reinstall, reinstall to become unresponsive, can not be installed

Workaround: Refer to Http://www.cnblogs.com/yangxia-test/p/4414397.html

7, start Apache, prompt php Startup

workaround : cmd command, input httpd.exe-w-n "Apache2"-K Start, view Apache log, show the following error

Apache can run, but see Error.log has httpd.exe:Could not reliably determine the server ' s fully qualified domain name, using 127.0.0 .1 for ServerName this error

workaround : Because DNS is not configured well. If you do not want to configure DNS, in httpd.conf, add ServerName localhost:80 at the top.

Testlink Learning One: Windows Build apache+mysql+php Environment

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.