Apache, PHP environment to build and try to connect you configure the mysql appears mysqli_connect (): The server requested authentication method unknown to the this problem

installation

First, download the compressed package from the official website, unzip to the specified directory,

Go to this directory, enter: httpd -k install -n "Apache"

PS: back n represents the name of the service

Ok appears after installation

bin / ApacheMonitor.exe next start extracting directory

 

 

If you can not start, the reason may be: port is occupied,

Solution: Modify the Apache Access Port

Open conf-> httpd.conf file, search Listen, you can modify the port

 

Modifying the Apache web root directory

Or in httpd.conf, search DocumentRoot

 

Modify the default Web site

 

 

 

 

Download PHP

https://windows.php.net/download#php-7.3

Solve direct download php file php file that appears when the browser issues

First in the Apache configuration file, add LoadModule php5_module D: /PHP/php5.5/php5apache2_4

 

In IfModule mime_module node is added:

AddType application/x-httpd-php .php .phtml

AddType application/x-httpd-php-source .phps

 

Finally restart the Apache can be.

 

 

After configuring the attempt to connect mysql appears mysqli_connect (): The server requested authentication method unknown to the this problem, checked and found mysql8 password mechanism is replaced cha2 cause, the solution is simple, to a SQL command:

ALTER USER 'username'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

 

 

Guess you like

Origin www.cnblogs.com/happystyle/p/11627601.html