Windows environment Configuration apache+mysql+php

Source: Internet
Author: User
Tags apache windows character set file copy php print vc9 versions phpmyadmin port number
For a long time did not write a blog, recently learning PHP, so the environment configuration to share with you.
Software Preparation:
The prepared software is shown in the following illustration.
Apache found 64 drops in the official wood, gave a special address, has been tested to run normally.
All other 64 places can be found at the official level.
Http://www.blackdot.be/?inc=apache/binaries Apache Bit
Apache the installation:
Note: This example only intercepts screenshots that need attention, and other defaults do not display.
1. server information can be configured by default, if the server's - The port is not occupied by another server program. Optional for all Users,on Port, as a Service - recommended. "If used only for the current user, use the 8080 port, manually start, select " Only for the "current" User, on Port 8080, when started manually. ". The port number can be modified through a configuration file.
2. "Typical" for the default installation, "Custom" for the user to customize the installation.
3. Click "Build Headers and Libraries" and select "This feature'll be installed on the local dirive."
4. The default installation path can be changed by selecting "Change", in this case by default.
5. The Apache Service Manager appears when the installation is complete.
The service management list has a service item that can now be started.
Note: If you do not appear in the Service Management list after installation Apache Service item indicates that an error occurred during the installation process and can be installed manually.
Use cmd Enter c:program filesapache Software foundationapache2.2bin This is my local installed directory, and perform httpd-k Install command, which prompts you to see it in the Service management list after success Apache service.
because my machine has installed this service properly, I am prompted for an error in the installation service when I execute this command . httpd related execution commands can be searched by themselves.
6. You can now test whether Apache is installed successfully. When the browser enters localhost or 127.0.0.1 if you choose not to use port 80 when installing, you need to add port number Access when you visit here.
 
2. You can change the location of the MySQL installation directory, this example remains the default.
3. After the completion of the check "Launch the MySQL instance Configuration Wizard" for MySQL configuration.
4. Select the configuration mode: "Detailed Configuration (Manual precise configuration)", "Standard Configuration (Standard configuration)", select "Detailed Configuration",
5. Select the server type, "Developer Machine (Develop test class, MySQL takes very little resources)", "Server Machine (server type, MySQL occupies more resources)", "dedicated MySQL server Machine (dedicated database server, MySQL consumes all available resources), generally choose "Server Machine". Can choose according to the actual situation. This example uses the development test type drop.
6. Choose the approximate use of MySQL database, "Multifunctional db (Universal multi-function, good)", "Transactional database only (server type, focus on transaction, General)", " Non-transactional Database only (non-transactional processing type, simpler, mainly do some monitoring, counting, MYSAM data type Support limited to non-transactional) ", select" Transactional Database only ", this example selects the universal multi-function type.
7. InnoDB tablespace configuration, is to InnoDB database files to choose a storage space, if modified, to remember the location, reload when to choose the same place, otherwise it may cause database damage, of course, to make a backup of the database will be no problem. Use the default location.
8. Select half of the Web site MySQL traffic, the number of simultaneous connections, "Decision Support (DSS)/olap (20)", "Online Transaction Processing (OLTP) (500 or so)", " Manual Setting (manually set, lose one number) ", select Online Transaction processing (OLTP)." This example selects the first item, because only the development test work is done on this machine.
9. Whether to enable TCP/IP connection, set the port, if not enabled, you can only access the MySQL database on their own machine, select "Enable TCP/IP networking" whether to enable TCP/IP connection, set the port, if not enabled, You can only access the MySQL database on your own machine and choose Enable TCP/IP networking.
10. Set the database language encoding, "Standard Character set" is the Western encoding, "best Support for Multilingualism" is RTF-8 encoded, "Manual Selected Default Character set/collation "To manually set the encoding, GBK, gb2312 for Chinese encoding, select best Support for Multilingualism."
One. "Install as Windows service" Choose to install the MySQL service, you can customize the name of the service.
"Include Bin Directory in Windows PATH" is an environment variable that adds MySQL to the machine.
12. Select "Modify security Settings" to be selected on the basis of the actual requirements "Enable root access from remote machines" to be able to access from other machines.
13. Complete the configuration and click "Execute" to perform the configuration.
The MySQL installation operation is complete.
Test MySQL
--------------------------------------------------------------------------------------------------------------- ---------------------------
Php the installation:
Extract the php-compressed package to the appropriate directory. In this case I put it under the E:program filesphp folder.
Php the configuration:
1. Copy the php.ini-dist in the E:program filesphp to php.ini.
If there is no Php.ini-dist file to use php.ini-development file and change name to PHP.ini (Leave a backup, good habit)
Development use of
Php.ini-produciton production machine used in
2, open E:program Filesphpphp.ini Modify the following statement line:
3, extension_dir = "E:program filesphpext"

4, Default_charset = "Utf-8"
5,
5, Extension=php_exif.dll, Php_gd2.dll, Php_imap.dll, Php_mbstring.dll, Php_mcrypt.dll, Php_mime_magic.dll , Php_mysql.dll, Php_mysqli.dll, php_pdf.dll before the semicolon ";"
6, in "Environment variables" in the "Path" to add:; E:program filesphp; E:program Filesphpext two values.
7, other configuration
1, in the writing PHP program sometimes appear such a warning: PHP warning:date (): It is not safe to rely on the system ' s timezone settings. You are are *required* to use the Date.timezone setting or the Date_default_timezone_set () function. In case you are used any of those methods and your are still getting this warning, for you most likely misspelled the timezone Iden Tifier. We selected ' UTC ' for ' 8.0/no DST ' instead in d:xxxxxxxxx.php on line 10. This is because the time that PHP takes is Greenwich mean time, so and your local time will be difference between Greenwich Mean time and Beijing time is about 8 hours, we can follow the following method to solve: 1, the use of Date_default_timezone_set in the page () Set my default timezone to Beijing time, that is, <?phpdate_default_timezone_set ("PRC");? > is OK. 2, in the php.ini set the value of Date.timezone for the PRC, set the following as: DATE.TIMEZONE=PRC, while canceling this line of code comments, that is, remove the semicolon on the front can be.
httpd.conf the configuration:
Location of the httpd.conf file: C:Program filesapache Software foundationapache2.2conf.
This is the directory I installed on my computer. Note: There are many tutorials on the web that need to PHP the directory of So-and- so DLL file Copy to System32 under, in fact this is not necessary, just to be in httpd.conf Loaded in PHP module can be.
Add and modify the following statement lines: LoadModule php5_module "E:/php/php5apache2_2.dll" (You need to add "", otherwise Apache will not start)
"PS:
if PHP not in the installation directory. Php5apache2_2.dll , it must be the wrong version of the download.
The official website has a few paragraphs on the left:
Which version do I choose?
If you are are using PHP with Apache 1 or Apache2 from apache.org your need to use the VC6 versions of PHP .....
so you download v6c versions of PHP
VC6 x86 Non Thread Safe
VC6 x86 Thread Safe
one is Thread Safe , one is Non Thread Safe ,
results, Non Thread Safe version of PHP During the installation process, no Apache the options:
Select the Web server wish to Setup
IIS FastCGI
Other CGI
Do not setup a Web server
and Thread Safe version of the installation process has Apache 2.2.x Module Options:
Select the Web server wish to Setup
Apache 2.2.x Module
APACEH CGI
IIS FastCGI
IIS CGI
NSAPI
Xitami
Netserve Web Server
Other CGI
Do not setup a Web server
------------------------------------------------------------------------------------------------------
PHP There are several different versions to choose from when downloading. That's VC6 X86 and VC9 X86 .
First I will answer:
VC6 What is it?
VC6 is Legacy Visual Studio 6 compiler , which is compiled using this compiler.
VC9 What is it?
VC9 is The Visual Studio 2008 Compiler , is to use Microsoft's VS compiled by the editor.
So how do we choose which version to download PHP it?
If you are in Windows used under apache+php , please select VC6 version;
If you are in Windows used under iis+php , please select VC9 version;
that Non Thread Safe What is it?
Non Thread Safe is not thread safe;
Thread Safe is what ?
Non Thread Safe is thread safe;
the authorities do not recommend that you Non Thread Safe apply to the production environment, so we choose Thread Safe version of PHP to use.
Phpinidir "E:/program files/php"
[
If you're in the link to the MySQL database,
Fatal error:call to undefined function mysql_connect () in c:xxxxx.php
That's because you didn't add this attribute.
]
DocumentRoot "C:/Program Files/apache Software foundation/apache2.2/htdocs" Project default storage path, can be modified according to the actual situation, Note: So the node modification corresponding Directories of directory nodes also need to be modified.
<directory "C:/Program files/apache Software Foundation/apache2.2/htdocs" >
AddType application/x-httpd-php. php
DirectoryIndex index.php index.html
Note: Apache Windows configuration file httpd.conf The directory separator required in is a slash "/" , while PHP Windows configuration file php.ini a backslash is required when writing a directory in " " , don't get mixed up.
Configure the test to create index.php print PHP configuration information in the directory specified by the DocumentRoot node.
You know.
--------------------------------------------------------------------------------------------------------------- ---------------------------
First, download
Download first on the internet phpMyAdmin , you can also go to phpMyAdmin The official website downloads, the address is: http://www.phpmyadmin.net/home_page/downloads.php and unzip it to Web can be accessed under the directory, if it is virtual space, can be extracted after the pass FTP The tool is uploaded to Web directory, and you can modify the name of the file after decompression.
Second, the configuration
Open Libraries directory under the config.default.php file, locate the following in turn, and follow the instructions to configure it.
1, Visit web site
2, MySQL Host Information
Fill in localhost or MySQL of the server where the IP address, if MySQL and the phpMyAdmin on the same server, press the default localhost
MySQL port, which defaults to 3306 , leave blank, if you install MySQL When you use the other port, you need to fill it out here.
3, MySQL user name and password
4, Authentication Method
There are four different modes to choose from, Cookies , http , HTTP , config;
Config mode is to enter the phpmyadmin access URL can be directly entered, without entering a username and password, is not safe, do not recommend use.
When the entry is set to a cookie , http or http , the login phpMyAdmin the data username and password are required for verification, as follows:
PHP installation mode is Apache , you can use http and cookies ;
The PHP installation mode is CGI and you can use cookies .
5, Phrase password ( Blowfish_secret ) is set up
6, Modify Interface Language
Modify this property to zh[ Simplified Chinese ]
7, Test phpMyAdmin
7. Well, I have to admit it's a magical website. The reason is that we did not start this service after we installed Apache.
8. As you can see, he has worked.
Apache is now installed and complete.
--------------------------------------------------------------------------------------------------------------- ---------------------------
Mysql the installation:
1. Select a user-defined configuration here
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.