Table of contents
foreword
This article introduces in detail the installation of the independent version of php+apache+MySQL under the window, so that you can better understand their working principle, and be familiar with configuring the personalized environment you need later, let's take a look~
Prepare
- php-5.4.8
- Apache-2.2.22
- mysql-5.5.22
- Navicat-8.1 for MySQL(
操作MySQL的工具
) - Create a www folder in the root directory of D drive (
也可在其它盘,本文案例默认D盘
)
php installation
(*The installation path must be consistent with the modified content path)
Input file: php-5.4.8-Win32-VC9-x86.zip
Steps
-
Extract it to a local
D:/php
directory -
Find the file in the php folder
php.ini-development
and change the file name tophp.ini
-
modify
php.ini
fileModifications:
- ctrl+f to find
php_curl
,Remove the semicolon in front of this line of code
; extension=php_curl.dll
- ctrl+f to find
mysql
,Remove the semicolon in front of these two lines of code
;extension=php_mysql.dll
;extension=php_mysqli.dll
- ctrl+f to find
php_gd2
,Remove the semicolon in front of this line of code
;extension=php_gd2.dll
- ctrl+f to find
php_openssl
,Remove the semicolon in front of this line of code
;extension=php_openssl.dll
- ctrl+f to find
php_pdo
,Remove the semicolon in front of this line of code
;extension=php_pdo_mysql.dll
Apache installation
Input file: httpd-2.2.22-win32-x86-no_ssl.msi
operation steps
- click to install
- Next
- Server information fill in
Network Domain:指定服务
Server Name:指定服务名称
Administrator's Email Addresss:指定邮箱
- Custom installation path
D:\Apache2.2
Next–>install–>finish
MySQL installation
- Create a MySQL folder in the root directory of the D drive
- Enter the MySQL installation package mysql-5.5.22-win32.msi
- Double click to install
Click Next to proceed to the next step of installation.
Select the installation type, there are Typical(默认)
, , Complete(完全)
and Custom(用户自定义)
three options. We choose Custom
Location to select MySQL under the D disk, and Next
is being installed... Please wait until the following interface appears
– "Next
Now the software installation is complete Now, the above interface appears, here is a very good function, mysql configuration wizard, no need to manually configure my.ini manually as before.
–” Next,
click “Next” to continue to the next step to continue. Select
the configuration method, Detailed Configuration(手动精确配置)
, Standard Configuration(标准配置)
, we choose to Detailed Configuration
select the server type, Developer Machine(开发测试类,mysql占用很少资源)
, Server Machine(服务器类型,mysql占用较多资源)
, Dedicated MySQL Server Machine(专门的数据库服务器,mysql占用所有可用资源)
, you choose according to your own type, generally, Server Machine
it will not be too small, and it will not be full.
Select the general purpose of the mysql database, Multifunctional Database(通用多功能型,好)
, Transactional Database Only(服务器类型,专注于事务处理,一般)
, Non-Transactional Database Only(非事务处理型,较简单,主要做一些监控、记数用,对MyISAM数据类型的支持仅限于non-transactional)
, I have chosen here Transactional Database Only
, press "Next" to continue
To InnoDB Tablespace
configure, is InnoDB
to choose a storage space for the database file. If you modify it, remember the location, and choose the same place when reinstalling, otherwise the database may be damaged. Of course, it is no problem to make a backup of the database , not detailed here. I have not modified here, use the default location, just press "Next" to continue.
Select the general mysql visits of the website, the number of simultaneous connections, Decision Support(DSS)/OLAP(20个左右)
, Online Transaction Processing(OLTP)(500个左右)
, Manual Setting(手动设置,自己输一个数)
, I choose here Online Transaction Processing(OLTP)
, press "Next" to continue.
Whether to enable TCP/IP connection, set the port, if not enabled, you can only access the mysql database on your own machine, I enable it here, tick the front, , on this page, you can also choose " Port Number:3306
Enable standard mode" ( Enable Strict Mode
), so that MySQL will not allow minor syntax errors. Standard mode is used here because it reduces the possibility of harmful data entering the database. Press "Next" to continue.
Western encoding, choose the third one here, then select or fill in Character Set gbk
,
press "Next" to continue.
Choose whether to install mysql as a windows service, you can also specify the Service Name (service identification name), whether to add the bin directory of mysql to ( Windows PATH
after adding, you can directly use the files under the bin without specifying the directory name, such as connection, "mysql.exe -uusername -ppassword;" is enough, you don't need to point out the complete address of mysql.exe, it is very convenient), I have ticked all of them here, and the Service Name remains unchanged. Press "Next" to continue.
This step asks whether to modify the password of the default root user (super administrator), we have modified the password here.
"New root password": root
(we set the database password here as root)
"Confirm (enter it again)": root
"Enable root access from remote machines (whether to allow root users to log in on other machines, if you want to be safe, don't tick on, tick it if you want it conveniently)".
Finally, "Create An Anonymous Account (create an anonymous user, anonymous users can connect to the database, but cannot operate data, including query)", there is no need to tick here, the setting is complete.
Press "Next" to continue
Confirm that the settings are correct, if there is a mistake, press "Back" to return to check. Press "Execute" to make the settings take effect
Then open cmd, enter the command line input net start mysql
, it prompts that the service name is invalid, and check the service list. If it has been started, the MySQL service is installed successfully.
net start mysql
carriage return
Navicat installation (attached)
We also need to install a tool to operate MySQL Navicat for MySQL
Get the Navicat for MySQL installation package navicat8_mysql_cs.exe, double-click to install
Select the installation directory and click "Next".
-"registration success
Click Connect to create a new connection:
输入连接名
- Password:
root
–> sure
all installations are complete!
Apache+php integration
Modify Apache conf
- " httpd.conf
file
- Add code at the bottom
LoadModule php5_module "D:/php/php-5.3.5/php5apache2_2.dll"
PHPIniDir "D:/php/php-5.3.5"
AddType application/x-httpd-php .php .phtml
注:D:/php/php-5.3.5指向php安装路径
View port
Generally, the default is 80, if it is occupied, modify it to other
Listen 80( 此处修改端口号
)
- Modify the php.ini file in php,Remove the semicolon in front of this line of code, and change "ext" to "D:/php/ext"
ctrl+f findextension_dir
; extension_dir = "ext"
D:/php is the php file package address
Verify Apache+php
Create a file under the www file. The content of index.php
the file
is:
<?php
phpinfo();
?>
Restart Apache, enter in the browser and http://127.0.0.1/index.php
the version form shown in the figure below appears, indicating that the installation is successful.
Finish!
Six years of code, no thinking, unforgettable
6 years of senior front-end supervisor, share technical dry goods, project practical experience, interview guidance,
follow bloggers to not get lost~