What should I do if linux php cannot connect to the mysql database?

藏色散人
Release: 2023-03-13 13:46:01
Original
3172 people have browsed it

Solution to the problem that linux php cannot connect to the mysql database: 1. Execute the command "apt install php-mysql"; 2. Restart the apache2 server by executing "service apache2 restart".

What should I do if linux php cannot connect to the mysql database?

The operating environment of this article: linux5.9.8 system, PHP7.2 version, DELL G3 computer

linux php cannot connect to mysql What about the database?

php cannot connect to mysql database in Linux (Ubuntu) environment

The reason is most likely that the php-mysql module is not installed;

The solution is as follows:

apt install php-mysql

After the installation is completed, execute the following command to restart the apache2 server

service apache2 restart

The following is the rendering:
What should I do if linux php cannot connect to the mysql database?

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of What should I do if linux php cannot connect to the mysql database?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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