A Preparation before installation:
? Prepare the installation software here is an example of the following software:
Appache:httpd-2.2.21-win32-x86-openssl-0.9.8r.msi
Mysql:mysql-5.5.21-win32.msi
Php:php-5.4.21-win32-vc9-x86.zip
Database processing software available phpMyAdmin, SQLyog (author recommended)
Note: PHP is available in two versions: VC9 is the Visual Studio compile, compiled with Microsoft vs Editor, VC6 is Legacy Visual Studio 6 Compile,non thread safe is non-thread safe, t Hread Safe Thread Safety, the official does not recommend the use of non thread safe for the production environment, so it is recommended to choose the thread safe, for more information please refer to the official website!
? Prepare the installation environment:
A: For the convenience of installation, it is best to ensure that there is no similar software such as Wamp,appserv
B: Create a folder under E disk PHP installs all relevant information under this folder
In the PHP folder to establish the MySQL folder (for the MySQL installation information), php-5.4.21 (for storing PHP installation information), WWW folder (for storing their own PHP code) Apache folder (for storing Apache installation information), Data file (for last database storage)
Two Installation:
(1) Install Apache first:
A. Double-click Httpd-2.2.21-win32-x86-openssl-0.9.8r.msi appears as:
Click Next to appear as
Check I accept the terms in the license agreement after appearing as
Click Next to appear as:
Fill in the relevant information in the text box as required, such as separate
Baidu.com
Www.baidu.com
[Email protected]
When you click Next, it appears as follows:
Where typical is a typical installation that is a fool-type installation, custom-defined installation
(Choose a custom installation here, of course), then click Next to appear as:
Click Next to appear as:
After that, because it is a custom installation, change the installation path to E:\php\apache,
Click Change again to make the path appear as:
Click Next to appear as:
Click Install to wait for a moment and a black box will appear but will soon disappear (or it will indicate that it is a failure)
Click Finish and it should be installed successfully! The lower left corner of the desktop appears as, then it should be installed successfully! Finally, we can rest!
Simple test: Enter 127.0.0.1 in the browser after entering the carriage return appears as
(2) Install MySQL:
Double-clicking the Mysql-5.5.21-win32.msi installation file appears as:
Wait for a moment to appear like:
Click Next and tick the I accept the terms in the License agreement as follows:
Click Next to appear as:
Select Custom to customize the installation and then click Next to appear as:
After that note, click Browser to change the installation path to appear as:
After changing the path, it appears as follows:
Click Next to appear as:
Click Install to appear as:
Wait...... (PRO, be patient!) ), which then appears as:
Click Next to appear as:
Click Next to appear as:
Click Finish to appear as:
Click Next to appear as:
(The default is detailed configuration, below is the standard configuration, here with the default)
Click Next to appear as:
Click Next to appear as:
Click Next to appear as:
Click Next to appear, and change to the following configuration:
Click Next to appear as:
Click Next to appear as and change to the configuration of the second image as follows:
(It's better to change the encoding format of the database into UTF8)
Click Next to appear as:
Click Next to appear as:
Enter the password as root (pro, remember this password OH) and click Next: (Do not tick create an anonymous account and enable root access from remote machines)
Click Next to appear as:
After clicking Execute, please be patient (especially the third circle) ...
If the third circle does not pass, I regret to tell you that the installation failed (press the main point of this document four-"other details", to unload the load!) )
There are four tick after click Finish then congratulations you should be successfully installed!
(If the installation fails, press the main point of this document four-"other details" method unloading load! )
Enter the DOS system from the command prompt, enter
Mysql-uroot-p
Then enter the password just after press ENTER, if it appears as if the installation was successful Oh!
(Want to see Welcome to the MySQL monitor really not easy ah, so oh to know how to cherish!) )
(3) Installing PHP
Unzip the file Php-5.4.21-win32-vc9-x86.zip to the php-5.4.21 folder you just built to successfully install PHP simple!
three. Related configuration:
(1) Apache configuration:
Locate the httpd.conf file directory E:\php\apache\conf
It's a good idea to back up httpd.conf and configure it.
? Add Phpinidir "e:/php/php-5.4.21" under # LoadModule Foo_module modules/mod_foo.so
(note here in English input method, there is a little error Apache can not start, here to specify the INI file PHP)
After adding the configuration:
# LoadModule Foo_module modules/mod_foo.so
#
Phpinidir "e:/php/php-5.4.21"
LoadModule Actions_module modules/mod_actions.so
?
In #loadmodule vhost_alias_module modules/mod_vhost_alias.so
Below to add the following configuration
LoadModule php5_module "E:/php/php-5.4.21/php5apache2_2.dll"
After adding the configuration:
#LoadModule Vhost_alias_module modules/mod_vhost_alias.so
LoadModule php5_module "E:/php/php-5.4.21/php5apache2_2.dll"
AddType application/x-httpd-php. php
AddType application/x-httpd-php. htm
AddType application/x-httpd-php. html
<ifmodule!mpm_netware_module>
? find DocumentRoot and change to the following configuration
(Here is where to tell the server where to find the PHP resources)
#
#DocumentRoot "E:/php/apache/htdocs"
DocumentRoot "E:/php/www"
#
Locate the directory and add the following content
<directory "E:/php/www" >
#
# Possible values for the Options directive is "None", "all",
# or any combination of:
Find <ifmodule dir_module> and more of the following:
<ifmodule dir_module>
DirectoryIndex index.php default.php index.html index.htm default.html default.htm
</IfModule>
Found: <ifmodule mime_module> and in
AddType application/x-compress. Z
AddType application/x-gzip. gz. tgz
Add the following (note: There are spaces before PHP)
AddType application/x-httpd-php. php
The settings here are for Apache to identify PHP files
Save and restart Apache after configuration.
Well, the configuration is over, test the chant!
In the E:\php\www directory, add the contents of phpinfo.php
<?php
Phpinfo ();
?>
Then enter 127.0.0.1 carriage return in the browser to appear
Click Phpinfo.php to show the following interface is TRUE configuration success!
(2) Configure MySQL and change the database storage address
Locate My.ini in E:\php\mysql, back up the file, and then modify the following
#Path to the database root
#datadir = "C:/Documents and Settings/all users/application data/mysql/mysql Server 5.5/data/"
Datadir= "E:/php/data"
# The default character set that would be used if a new schema or table is
Restart MySQL after saving (restart in the following directory, right-click My Computer--management services and applications, services)
Locate C:\Documents and Settings\All Users\Application Data\mysql\mysql Server 5.5\data
(here is a slightly different storage location depending on the operating system data)
and copy the content under data to E:\php\data.
After the relevant changes to test the Bai!
To Dos to create a database to see if the database is created to save to the E:\php\data, if the successful save that the configuration is really successful!
(3) PHP configuration:
?
In Php-5. 4.21 folder find Php.ini-development or php.ini-production change it to php.ini (of course, it's better to back up first)
; extension_dir = "./"
Extension_dir= "E:/php/php-5.4.21/ext"
(used to specify the extension path for PHP)
? Remove the semicolon before the following content
; Extension=php_bz2.dll
; Extension=php_curl.dll
(To enable the extension library, later want to launch other extension libraries, just remove the corresponding local code semicolon!) )
Restart Apache and test after saving
Four Other Details:
MSYQL installation to the last step start service error resolution
1. Go to the Control Panel and remove MySQL first.
2. Delete MySQL under C-Disk C:\Documents and Settings\All Users\Application Data.
3. If you have a directory on another disk, you also need to delete it. Empty directories are also deleted
4. Go to regedit to register the registry
Hkey_local_machine/system/controlset001/services/eventlog/applications/mysql (usually in this directory)
(It can be re-installed in general!) )
Hkey_local_machine/system/controlset002/services/eventlog/applications/mysql
Hkey_local_machine/system/currentcontrolset/services/eventog/applications/mysql
(If any, delete all!) Tip: Use the F3 loop to find "MySQL")
5. If the contents of MySQL in Task Manager are also deleted
6. Turn off the firewall.
7. Reinstall MySQL (I did not restart the computer here)
Restart the computer, deactivate IIS, and delete temporary files in temp when it is necessary to reload.
If this is not the case, when configuring MySQL, replace the MySQL service with a service name.
Statement:
The above installation process is personal only talk if there is not perfect, please understand, but absolutely after many tests and success, and can be used for Win8, Win7 and XP system, if you want to install under Linux system please refer to other documents, I hope that everyone's path of PHP learning is smooth enough.
2014-01-10
PHP Standalone Environment Construction details