Configure the PHP + MySql + Apache environment in Win7 64-bit Operating System

Source: Internet
Author: User
Tags vc9

1. Install software
The software version is based on your own installation. For other versions, the software can be downloaded from various official websites.
1. Apache (httpd-2.2.19-win64)
2. PHP (php-5.3.6-Win32-VC9-x64)
3. MySQL (MySQL_5.5.13_winx64)
 
Ii. install Apache
1, 64-bit Apache is different from 32-bit package into exe file can be directly installed, the first httpd-2.2.19-win64 to decompress E: /server/apache-httpd-2.2.19-win64/(/* E is the drive letter of the specific server File */)
2. Run the command prompt (START-Program-Attachment) as administrator to enter E:/server/apache-httpd-2.2.19-win64/

3. Execute httpd-k install

 

4. Modify httpd. conf. The configuration is the same as that in the 32-bit system.
(1) Modify ServerRoot "E:/server/httpd-2.2.19-win64 /"
(2) The following shows the functional modules enabled by apache: # LoadModule vhost_alias_module modules/mod_vhost_alias.so
Add the following modules:
LoadModule php5_module "E:/Server/php-5.3.6-Win32-VC9-x64/php5apache2_2.dll"
PHPiniDir "E:/Server/php-5.3.6-Win32-VC9-x64 /"
AddType application/x-httpd-php. html. htm. php
(3) continue and find the line DocumentRoot "E:/Code/PHP/" to set the webpage file directory.
This row must be modified in accordance with the <Directory "E:/Code/PHP/"> Directory setting after the row # This shocould be changed to whatever you set DocumentRoot

5. Run httpd-k start at the command prompt again. If no error occurs, the apache service starts successfully.


3. Configure PHP
1. As mentioned above, I decompress the php Directory to E:/Server/php-5.3.6-Win32-VC9-x64/that corresponds to the LoadModule location set in Apache
2. Change php. ini-development to php. ini.
3, open php. ini, find extension_dir, modify its value to E:/Server/php-5.3.6-Win32-VC9-x64/ext/That is, php file directory/ext
4. Find the extension list, extension = php_gd2.dll, extension = php_mysql.dll,
; Extension = ";" before php_mysqli.dll is removed to enable the extension. Of course, the above extension is used as an example. You can enable the corresponding extension based on different functions.
5. (optional) the value of date. timezone is set to Asia/Shanghai, that is, date. timezone = Asia/Shanghai.
6. Create a test. PHP file under E:/Code/PHP/. The content is
<? Php
Phpinfo ();
?>
Enter http: // localhost/test. php in the address bar of the browser.

The configuration is successful as shown in the following figure.


Iii. Install MySql
1. Double-click the MySQL installation package and click Next.
2. Setup Type (installation options): Typical (Typical), Complete (Complete), and m (Custom ). Select Custom and click Next.
3. Custom Setup (Custom installation settings). Click "Entire feature will be installed on local hard drive" in the inverted triangle to install all the items, click the Change button below, select the installation location, and click Next. Note: Check the installation location of all options. It is best to install them in the same location.
4. Ready to Install the Program (prepare the installation Program), observe the settings in the middle, and click Next. Otherwise, click Back and modify.
5. During the installation process, a new window is displayed, which advertises MySQL Enterprise (MySQL Enterprise Edition). If you ignore the window, click Next until the window is closed.
6. Wizard Complete (the Installation Wizard is Complete), click the check box before Launch the MySQL Instance Configuration Wizard (start mysql Configuration Wizard), and then click Finish to enter the MySQL Configuration interface.
7. click Next.
8. select the configuration method (Please select a configuration type ). There are two options: Detailed Configuration (Detailed Configuration) and Stardard Configuration (standard Configuration). Here we choose Detailed Configuration.
9. select the server type (Please select a server type ). There are three options: Developer Machine (for development and testing), Server Machine (for servers), and Dedicated MySQL Server Machine (for Dedicated servers). Since I am used for development, so select the first item and click Next.
10. select database usage ). There are three types: Multifuctional Database, Transactional Database Only, and Non-Transactional Database Only, however, according to the English comments and other online post references, the first Multifuctional Database is selected, and then click Next.
11. select the file storage location of the InnoDB database (Please select the drive for the InnoDB datafile). the default location is the MySQL installation location. Keep the default value and click Next.
12. Select the exact traffic (Please set the approximate number of concurrent connections to the server) that is connected to the server at the same time ). Three options: demo-support (DSS)/OLAP (about 20), and Online Transaction Processing (OLTP) (about 500 ), the third is Manual Settings (Manual setting). Because I used it for development and testing, select the first one and click Next.
13. network options (Please select the networking options ). The first is whether to Enable TCP/IP connection. I did not select this option. Therefore, I can only access the SQL database on my computer, and the second is Enable Strict Mode, we recommend that you select this option for new users, so that the code is more standard.
14. select the default character set (Please select the character set ). The first is Stardard Character Set (standard Character Set). The default value is Latin1, which is suitable for English storage. The second value is Best Support for Multilingualism (most suitable for multiple languages). The default value is utf8, it is suitable for storing multilingual character sets. The third option is manual selection. Here we select UTF8 encoding, that is, UTF8 in the second or third type.
15. set windows options (Please set the windows options ). The first option is whether to Install the Windows Service (Install As Windows Service). We recommend that you check that the following Service Name is the Name of the server ID, which is the default option, and whether to randomly start MySQL, if this option is not selected, you need to enter net start MySQL on cmd to enable mysql later. The second option is whether to add the bin folder Path to the PATH (Include Bin Directory in Windows Path) in the environment variable. We recommend that you select this option, in this way, you can directly enter any file in the bin folder on cmd.
16. Please set the security options ). The first option is to Modify the Security Settings. The two items in this option are the new root password and the password that you have entered (that is, enter it again ), create An Anonymous Account (Create An Anonymous Account) at the bottom. If this is not required for me, I will not select it. Then click Next.
17. Prepare to execute the preceding settings (Ready to Execute). After confirming that the settings are correct, click execute. After a while, click Finish to complete the settings. Restart Apache.


Finally, modify index. php In the site directory:
<? Php
$ Host = 'localhost ';
$ User_name = 'root ';
$ Password = '*****'; // here ***** is the password you set

$ Conn = mysql_connect ($ host, $ user_name, $ password );
If (! $ Conn)
{
Die ('database Connection Failed: '. mysql_error ());
}
Echo 'database connection successful! ';

If (mysql_close ($ conn ))
{
Echo '<br/>... <br/> ';
Echo 'the connection to the database has been closed successfully ';
}
?>

Enter http: // localhost in the browser:
Database Connection successful!
...
The connection to the database has been closed successfully.
It means everything is done!

Postscript:In fact, the configuration of the php environment in a 64-bit system is roughly the same as that in a 32-bit system. The only difference is the installation configuration of apache. If you have any experience, you need to install apache and configure it.

Source: http://meego123.net /? Post = 86

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.