您的位置 首页 php

php pdo 连接数据库报2002错误解决

selinux 介绍

SELinux 全称 Security Enhanced Linux (安全强化 Linux),是 MAC (Mandatory Access Control,强制访问控制系统)的一个实现,目的在于明确的指明某个进程可以访问哪些资源(文件、 网络端口 等)。

查看SELinux状态:

1、/usr/sbin/sestatus -v

SELinux status: enabled

2、getenforce #也可以用这个命令检查

关闭SELinux:

1、临时关闭(不用重启机器):

setenforce 0 #设置SELinux 成为permissive模式

#setenforce 1 设置SELinux 成为enforcing模式

2、永久生效:

修改/etc/selinux/config 文件

将SELINUX=enforcing改为SELINUX=disabled

重启机器即可

文章来源:智云一二三科技

文章标题:php pdo 连接数据库报2002错误解决

文章地址:https://www.zhihuclub.com/150264.shtml

关于作者: 智云科技

热门文章

网站地图