简体   繁体   English

在PHP中启用mysql支持

[英]Enabling mysql support in PHP

I am trying to add MySql support in PHP. 我试图在PHP中添加MySql支持。 I am using PHP version 7.2.11. 我正在使用PHP版本7.2.11。 When i'm trying to run my application, it shows the following error: 当我尝试运行我的应用程序时,它显示以下错误:

Your PHP installation does not have MySQL support. Please enable MySQL support in PHP or ask your web host to do so for you.

This problem didn't occur when i tried with older versions of PHP. 当我尝试使用旧版本的PHP时,没有发生此问题。 Any help would be appreciated. 任何帮助,将不胜感激。

1- Update the required packages If your are running an Ubuntu VPS and PHP 7, then run the following commands: 1-更新所需的软件包如果您正在运行Ubuntu VPS和PHP 7,请运行以下命令:

apt-get update
apt-get install php7.0-mysql

if you are running a CentOS VPS and you have PHP 7, then run the following commands to fix the problem: 如果您正在运行CentOS VPS且具有PHP 7,请运行以下命令来解决该问题:

yum update
yum install php70w-mysql

2- Restart the Web Server, 2-重新启动Web服务器,

If your are running an Ubuntu, then run the following commands: 如果您正在运行Ubuntu,请运行以下命令:

sudo service apache2 reload

If your are running an CentOS, then run the following commands: 如果您正在运行CentOS,请运行以下命令:

sudo systemctl reload httpd.service

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM