Undefined class constant 'MYSQL_ATTR_INIT_COMMAND' with pdo

后端 未结 11 2147
暖寄归人
暖寄归人 2020-11-29 07:27
$db = new PDO(\'mysql:dbname=xnews;host=localhost;port=\' . $LOCAL_DB_PORT, 
          $LOCAL_DB_USER, 
          $LOCAL_DB_PASS, 
          array(PDO::MYSQL_ATTR_IN         


        
11条回答
  •  广开言路
    2020-11-29 07:56

    For Centos I was missing php-mysql library:

    yum install php-mysql
    
    service httpd restart
    

    There is no need to enable any extension in php.ini, it is loaded by default.

提交回复
热议问题