Manually set up Apache+PHP+MySQL method record under Windows7

  
 

Local Debug Word
Press theme has always used XAMPP to build a local environment, but I don’t know why, in more frequently called themes (such as CMS class), the computer will be stuck, and the viewing process is Apache. The CPU of the two processes with MySQL occupies a high level. The specific reason is unknown. I rarely confuse the host environment configuration. I don't understand it. Maybe it is a problem that my host is too old (single-core CPU).

Decision: After enduring a few months of slowness, decided to manually build Apache+PHP
+MySQL (also listened to jiucool saying that he is also manually built, quite fast), after cumbersome steps After the construction was successful, it seems that it seems to be faster, at least not stuck. Of course, maybe it's RPWT, or an illusion. Regardless of the embarrassment, it feels OK to use it. This article is used to record the specific steps. Please consult Google for the principle. Of course, you are afraid that Google will be forced to use the wind. You can use Baidu to know, but don’t know if you are looking for Google. Let's go.

Original reference: http://www.leapsoul.cn/?p=695

Test environment: Windows
7 (other win versions are not tested, generally the same)

First, go to the official download code package, package

1. Apache: download address, I downloaded httpd-2.2.17-win32-x86-openssl-0.9.8o .msi

2. PHP: Download address, I downloaded php-5.3.4-Win32-VC6-x86.zip

3. MySQL: Download address, I downloaded mysql -5.5.8-win32.msi

4. phpMyAdmin: Download address, I downloaded phpMyAdmin-3.3.8.1-all-languages.7z

Second, install, unzip

1. Apache

Mainly configure Network Domain, Server Name, Email address (I fill in localhost, localhost, email, etc.) and the occupied port of Apache service. The default is 80 port, you can Need to be configured on other ports, Apache installation directory you can use the default directory or choose the installation directory according to your needs (I installed to D: \\ Apache).

After completing the installation of the apache service, enter http://localhost/in the browser and the words It’s work! appears, indicating that the Apache service installation is successful.

2. PHP

Just unzip php-5.3.4-Win32-VC6-x86.zip and rename the folder to php to a disk to complete the PHP installation (I will Copy it to the D drive directory D:\\php)

3. MySQL

Click Mysql installer to install it automatically. During this time, you can select the installation directory of Mysql database according to your needs. Installed to D:\\MySQL), MySQL will start the wizard after installation, you can cancel first, the next configuration is said.

Three, configuration

1. Apache (Apache configuration file httpd.conf in the conf folder under the Apache installation directory)

(1) Default Apache server implementation WEB The main program directory is Apache2.2/htdocs, so when your WEB main program directory changes, we need to modify the corresponding Apache configuration (I changed to D:\\localhost\\htdocs), that is, open httpd.conf with text editing software. Modify

DocumentRoot "D:/Apache/htdocs"

to

DocumentRoot "D:/localhost/htdocs"

and

< ;Directory "D:/Apache/htdocs">

Modified to

<Directory "D:/localhost/htdocs">

(2)Modify the specific index file successively Order, due to the configuration of the PHP function, of course, need index.php priority execution

find

DirectoryIndex index.html

modified to

DirectoryIndex index.php index.html 

(3) Make Apache support PHP

Find

#LoadModule vhost_alias_module modules/mod_vhost_alias.so

Add the following content below it (note the php installation path)

LoadM Odule php5_module "d:/php/php5apache2_2.dll"PHPIniDir "d:/php"AddType application/x-httpd-php .php .html .htm

Description: We can see multiple in the PHP directory The php5apache dll file, since we are using Apache2.2.17, we certainly need to use php5apache2_2.dll, then specify the PHP installation directory and the program extension to execute.

2. PHP (configuration file php.ini in the PHP installation directory)

(1) Rename php.ini-development to php.ini, and then modify php with a text editor. Ini, the next steps are all done in php.ini.

(2) Find

; On windows:; extension_dir = "ext"

Change to

; On windows:extension_dir = "D:/php /ext"

indicates the specific directory of the specified PHP extension package to call the corresponding DLL file.

(3) Since the default PHP does not support automatic connection to Mysql, you need to open the corresponding extension library function, such as php_mysql.dll, etc., will soon

;extension=php_curl.dll;extension=php_gd2 .dll;extension=php_mbstring.dll;extension=php_mysql.dll;extension=php_pdo_mysql.dll;extension=php_pdo_odbc.dll;extension=php_xmlrpc.dll

Remove the English semicolon (;) in front of it, as follows

extension=php_curl.dllextension=php_gd2.dllextension=php_mbstring.dllextension=php_mysql.dllextension=php_pdo_mysql.dllextension=php_pdo_odbc.dllextension=php_xmlrpc.dll

(4)Configure PHP's Session function

When using the session function, we must configure the session file to save the directory on the server, otherwise we can not use the session, we need to create a new readable and writable directory folder on Windows 7, this directory is best independent of the WEB main program directory Here, I created the phpsessiontmp directory on the D:\\localhost directory, and then found

;session.save_path = "/tmp"

modified in the php.ini configuration file
< Pre>session.save_path = "D:/localhost/phpsessiontmp"

(5)Configure PHP file upload function

As with session, when using PHP file upload function, we must specify a temporary folder to complete File upload function, otherwise the file upload function will fail, we still need to create a readable and writable directory folder on Windows 7, here I created the phpfileuploadtmp directory on the D:\\localhost directory, and then in the php.ini configuration file Found

;upload_tmp_dir =

modified to

upload_tmp_dir = "D:/localhost/phpfileuploadtmp"

(6)Modify date.timezone, otherwise date when executing phpinfo Some will report an error: Warning: phpinfo() [function.phpinfo]…

Found

;date.timezone =

modified to

date.timezone = Asia/Shanghai

3. MySQL

Click Mysql Server Instance Config Wizard in the Mysql Server5.5 menu under the Start menu to complete the Mysql configuration wizard.

Copyright © Windows knowledge All Rights Reserved