当前位置:网站首页>Apache+php+mysql environment construction is super detailed!!!
Apache+php+mysql environment construction is super detailed!!!
2022-07-03 05:37:00 【GuJingnan~】
Preface : Studying recently PHP Language , Sort out the part about environment construction , You can also choose an integrated environment, which will be more convenient , Setting up your own environment will help you better understand the principle , Suitable for beginners , It will be updated continuously ~~~
Determine the location of the server VC edition ( Be sure to look at it. , Avoid the following mistakes )
Version inconsistencies can lead to Apache In the load php Error in package , like this :

Determine the server VC Steps for version :
1. View the server's... In the control panel VC edition .
Installation configuration Apache
Be careful :Apache Unable to resolve php file , Need to install php
download
obtain Apache Compressed package , Select the version that matches your server to download , Just unzip .( Official website :https://www.apachehaus.com)

Directory description

bin Catalog :
To configure
1. stay httpd.conf Find Define SRVROOT. Change to Apache Storage directory ( Here is :C:\SERVER\Apache24)

2. install Apache The main service of httpd.exe( It is a process running independently in the background , With it ,Apache To start ), It has been downloaded here , Therefore, the prompt has been downloaded .

3. Found in the installation directory ApacheMonitor.exe Double click start up , An icon appears in the lower right corner (C:\SERVER\Apache24\bin)

4. Test whether the configuration is successful : View modules used ( Get into bin Catalog , Use command :httpd.exe -M)
Installation configuration PHP
download PHP Language
- obtain PHP The installation files ( Official website )


Here, be sure to download the second version , Otherwise there may not be apache Support package !!!

2. Unzip and rename

Directory description

php.exe Application
php.exe ==> take php The code turns into HTML Code , So that the browser can parse .
- stay apache master station (C:\Apache\Apache24\htdocs) Write a php Code ,index.php.

2、 adopt cmd The controller enters php.exe In the directory ( Here is Apache/php-7.0.2)
adopt php.exe Run the command to specify the php Script :php.exe -f php File path , It can be executed PHP Code , Output hello world.

To configure Apache load PHP modular
Be careful : After configuration ,PHP If the configuration file is modified, it must be restarted Apache Will take effect !!!
principle :
- Apache Assign work to PHP modular , If it is PHP The code is left to PHP Handle : File suffix judgment .php The end must be PHP Code .
- take PHP Load the configuration file of into Apache In profile : Take effect together .
step :
1. stay Apache It is specified in PHP The path of the configuration file , stay Apache Primary profile for (C:\SERVER\Apache24\conf\httpd.conf) Load in PHP Module provided (C:\SERVER\php-7.0.2\php5apache2_2.dll).

2. Verify that the load was successful , Get into C:\SERVER\Apache25\bin Execute... In the path httpd.exe -M( Note here M Capitalization )

3.Apache Assign work to PHP modular , If it is PHP The code is left to PHP Handle , File suffix judgment .php The end must be PHP Code .

4. Check if the configuration is successful , Use httpd.exe -t Check the syntax for errors . notice OK That's all right. .
5. take PHP The configuration file is loaded into the Apache In profile , Take effect together .(3.1 PHPIniDir php.ini Location path )

6. 3.2 php.ini The file does not exist by default , In order to development and production Format exists , Need to format .( It is recommended to make a copy and modify the suffix )

7. Test success : Write a php file .

Installation and configuration MySQL
install MySQL Software
1. Download the installation package from the official website , Double click to install

2. Agree to proceed to the next step .
3. Choose the installation type , Custom installation , Select the installation directory ( Software installation directory and data installation directory ).
For the convenience of management :
Software installation directory :SERVER\mysql
Data installation directory :SERVER\mysql\data



4. After the installation, the configuration is realized .

5. Select detailed configuration

6. Selection environment

7. Select function ( Default )

8. Concurrent mode selection ( Default )

9. Select access mode
10. Choose character set

11. Service installation , Set up MySQL Self starting
12. Input root( Super administrator ) The user password of .

13. Waiting for configuration : All four are successful only if they are ticked .

Directory description
bin Catalog
Software design structure :C/S and B/S:
C/S:Clint client /Server Server side , Users need to install client products to access the server , And can only access one kind of software ( At present, I am ).
B/S:Browser browser /Server Server side , Users only need to install the browser , You can access all servers (B/S Architecture Services ).
Access Process
MySQL Is a C/S Architecture software , You need to access the server through the client (MySQL It also provides access to other modes : Act as a client through some plug-in extensions ).
Sign in :
MySQL The client access server needs to find a match ; Connection authentication connection :IP And port confirmation , If it is local, you can omit .
-h The host address ---> -hlocalhost( It can be IP)
-p port ---> -p3306
authentication : Enter the server through user name and password
-u user name ---> -uroot Don't omit ( Except anonymous users )
-p password ---> -proot
To configure PHP load MySQL Expand
PHP It does not have the ability to operate MySQL Database capabilities , Need help PHP operation MySQL The extended implementation of .
1.PHP load MySQL Expand (apache Need to restart );php.ini In file :

2. Check if the configuration is successful , adopt phpinfo Interface to judge .


Only MySQLIND, Description: the configuration was not successful .

2.PHP All extensions are ext In the folder , You need to specify the path where the extension is located :extension_dir

(php.ini Has been apache load , So it needs to be restarted to take effect )
## By calling phpinfo(), See if the configuration is successful .
Set up PHP System time zone
adopt php.ini Medium timezone Configuration to realize .( Need to restart apache)
###PRC It means time zone of China

边栏推荐
- Final review (Day5)
- Hotel public broadcasting background music - Design of hotel IP network broadcasting system based on Internet +
- Win10 install pytullet and test
- 中职网络子网划分例题解析
- "250000 a year is just the price of cabbage" has become a thing of the past. The annual salary of AI posts has decreased by 8.9%, and the latest salary report has been released
- Es 2022 officially released! What are the new features?
- Source insight License Activation
- Making coco datasets
- 2022.7.2day594
- Differences among bio, NiO and AIO
猜你喜欢

"C and pointer" - Chapter 13 advanced pointer int * (* (* (*f) () [6]) ()

6.23 warehouse operation on Thursday

Map的扩容机制

【一起上水硕系列】Day 10

Training method of grasping angle in grasping detection

College campus IP network broadcasting - manufacturer's design guide for college campus IP broadcasting scheme based on campus LAN

Altaro set grandfather parent child (GFS) archiving

小学校园IP网络广播-基于校园局域网的小学IP数字广播系统设计

Redis cannot connect remotely.

BTC-密码学原理
随机推荐
Technical analysis of qianyuantong multi card aggregation router
[set theory] relational closure (relational closure related theorem)
How to install and configure altaro VM backup for VMware vSphere
kubernetes资源对象介绍及常用命令(五)-(ConfigMap)
Go practice -- gorilla/rpc (gorilla/rpc/json) used by gorilla web Toolkit
SimpleITK学习笔记
Final review Day8
Redis Introduction et explication des types de données
Obtenir et surveiller les journaux du serveur distant
Capacity expansion mechanism of map
Introduction to redis and explanation of data types
"C and pointer" - Chapter 13 function of function pointer 1 - callback function 1
期末复习(Day5)
Redis使用Lua脚本简介
Apache+PHP+MySQL环境搭建超详细!!!
NG Textarea-auto-resize
Final review (Day5)
Talk about how to use p6spy for SQL monitoring
Skip table: principle introduction, advantages and disadvantages of skiplist
(subplots用法)matplotlib如何绘制多个子图(轴域)