Home > PHP Framework > ThinkPHP > Detailed graphic explanation of the steps and methods for installing jdk environment variables in TP5.1

Detailed graphic explanation of the steps and methods for installing jdk environment variables in TP5.1

藏色散人
Release: 2021-09-02 08:59:08
forward
2016 people have browsed it

First configuration changes and library class changes

Open debugging mode
5.1 configuration file is in the app/config folder // Application debugging mode in app.php under 'app_debug'=> false, change it to true.
Changes in library class calling
Original: use:think\Request; Now use:think\facade\Request;
Detailed graphic explanation of the steps and methods for installing jdk environment variables in TP5.1

You can use version 5.0 Method
$id = Request::instance()->param('id/d');
Detailed graphic explanation of the steps and methods for installing jdk environment variables in TP5.1

Verification issues in version 5.1

It keeps reporting that app/index/course->Validate;

The solution is to rewrite in model/Course.php:

Detailed graphic explanation of the steps and methods for installing jdk environment variables in TP5.1

Create database time zone problem

Detailed graphic explanation of the steps and methods for installing jdk environment variables in TP5.1

##java.sql.SQLException: The server time zone value 'Ãà ¹ú±êüñ¼ä' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.


Cause of time zone problemCause: When using mysql’s jdbc driver (6.0), problems caused by the time zone difference between the database and the system are encountered .

Detailed graphic explanation of the steps and methods for installing jdk environment variables in TP5.1
SolutionAdd
?serverTimezone=UTC

jdbcUrl=jdbc:mysql://localhost:3306/course?serverTimezone=UTC
Copy after login

If there is a Chinese garbled problem Solution

jdbcUrl=jdbc:mysql://localhost:3306/course?serverTimezone=Asia/Shanghai&characterEncoding=utf8
Copy after login

Environment variable installation

Detailed graphic explanation of the steps and methods for installing jdk environment variables in TP5.1

##JAVA_HOME: JDK installation directory

Function: Other related environment variable configurations can be referenced, which is more convenient and concise.
Path:%JAVA_HOME%bin;%JAVA_HOME%jrebin;
Function: Allow the system to find and call java.exe and javac.exe.
classpath:.;%JAVA_HOME%libdt.jar;%JAVA_HOME%libtools.jar
Function: The role of the classpath environment variable--tell the java virtual machine that all executable files.class Where

Detailed graphic explanation of the steps and methods for installing jdk environment variables in TP5.1

Let us make sure the installation is successful

Press the shortcut key Win R, enter cmd, and press Enter.
Check whether the Java environment is configured successfully

Enter

java


Detailed graphic explanation of the steps and methods for installing jdk environment variables in TP5.1Then we enter

javac


Detailed graphic explanation of the steps and methods for installing jdk environment variables in TP5.1Finally, enter

java -version


Detailed graphic explanation of the steps and methods for installing jdk environment variables in TP5.1You can see the above three pictures, and the environment variables are configured. .

The above is the detailed content of Detailed graphic explanation of the steps and methods for installing jdk environment variables in TP5.1. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template