当前位置:网站首页>Apache+php+mysql environment construction is super detailed!!!
Apache+php+mysql environment construction is super detailed!!!
2022-06-24 19:42:00 【Game programming】
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 )

- 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

author :GuJingnan~
Game programming , A game development favorite ~
If the picture is not displayed for a long time , Please use Chrome Kernel browser .
边栏推荐
- How to use JWT authentication in thinkphp6
- Full link service tracking implementation scheme
- System design idea of time traceability
- 怎么使用R包ggtreeExtra绘制进化树
- php OSS文件讀取和寫入文件,workerman生成臨時文件並輸出瀏覽器下載
- UART communication (STM32F103 library function)
- ###脚本实现raid0自动化部署
- flink-sql的kafka的这个设置,group-offsets,如果指定的groupid没有提
- How to select the ECS type and what to consider?
- Download steps of STM32 firmware library
猜你喜欢

Information theory of popular science Shannon

【Go语言刷题篇】Go从0到入门4:切片的高级用法、初级复习与Map入门学习

starring开发HttpJson接入点+数据库

特尔携手微软发挥边云协同势能,推动AI规模化部署
![[go Language brossage] go from 0 to Getting started 4: Advanced use of slice, Primary Review and Map Getting started Learning](/img/3a/db240deb4c66b219ef86f40d4c7b7d.png)
[go Language brossage] go from 0 to Getting started 4: Advanced use of slice, Primary Review and Map Getting started Learning

A detailed explanation of the implementation principle of go Distributed Link Tracking

Unity mobile game performance optimization spectrum CPU time-consuming optimization divided by engine modules

技术实现 | Apache Doris 冷热数据存储(一)

模块五

R语言 4.1.0软件安装包和安装教程
随机推荐
Kubernetes集群部署
High dimension low code: component rendering sub component
Php OSS file read and write file, workerman Generate Temporary file and Output Browser Download
60 个神级 VS Code 插件!!
At present, only CDC monitors Mysql to get the data of new columns. Sqlserver can't, can it
Confirm whether the host is a large terminal or a small terminal
Docker installing MySQL
Information theory of popular science Shannon
What are the functions of IBPs open source form designer?
微信小程序轮播图怎么自定义光标位置
全链路业务追踪落地实践方案
Oracle create tablespaces and tables
flink cdc全量读mysql老是报这个错怎么处理
LCD12864 (ST7565P) Chinese character display (STM32F103)
What do I mean when I link Mysql to report this error?
请问一下2.2.0版本支持动态新增mysql同步表吗
应用实践 | 海量数据,秒级分析!Flink+Doris 构建实时数仓方案
R for Data Science (notes) -- data transformation (used by filter)
Clustered index (clustered index), nonclustered index (nonclustered index)
[computer talk club] Lecture 3: how to raise key issues?