升级到php 5.3.x后找不到PDO类致命错误

编程入门 行业动态 更新时间:2024-10-16 00:19:26
本文介绍了升级到php 5.3.x后找不到PDO类致命错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我们进行了服务器升级,将表格5.2.x移至php5.3.x.我是mysql pdo,代码如下所示,在升级之前可以正常工作.

We had a server upgrade where we moved form 5.2.x to php 5.3.x. I was mysql pdo with the code showen below which was working before the upgrade.

<?php error_reporting(E_ALL); ini_set('display_errors', '1'); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Database user / pass */ $sql_details = array( "user" => "", "pass" => "", "host" => "", "db" => "" ); // This is included for the development and deploy environment used on the DataTables // server. You can delete this block - it just includes my own user/pass without making // them public! if ( is_file($_SERVER['DOCUMENT_ROOT']."/datatables/pdo.php") ) { include( $_SERVER['DOCUMENT_ROOT']."/datatables/pdo.php" ); } // /End development include /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Database connection */ /* PDO connection */ $db = new PDO( "mysql:host={$sql_details['host']};dbname={$sql_details['db']}", $sql_details['user'], $sql_details['pass'], array( PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION ) ); /* mysql_* connection */ /* if ( ! $db = mysql_pconnect( $sql_details['host'], $sql_details['user'], $sql_details['pass'] ) ) { header( $_SERVER['SERVER_PROTOCOL'] .' 500 Internal Server Error' ); die( 'Could not open connection to server' ); } if ( ! mysql_select_db( $sql_details['db'], $db ) ) { header( $_SERVER['SERVER_PROTOCOL'] .' 500 Internal Server Error' ); die( 'Could not select database' ); } */

但是升级后,我收到一个致命错误,即找不到PDO类.我检查ht php.ini并启用了pdo.以下是php.ini中的代码段.

But after the upgrade, i get a fatal error that PDO class not found. I check ht php.ini and pdo is enabled. Below is the snippet from php.ini.

'--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-mysqli=/usr/bin/mysql_config' '--with-openssl=/usr' '--with-openssl-dir=/usr' '--with-pcre-regex=/opt/pcre' '--with-pdo-mysql=shared' '--with-pdo-sqlite=shared' '--with-pic' '--with-png-dir=/usr' '--with-sqlite=shared' '--with-xpm-dir=/usr' '--with-zlib' '--with-zlib-dir=/usr' pdo_mysql pdo_mysql.default_socket => /var/lib/mysql/mysql.sock => /var/lib/mysql/mysql.sock pdo_sqlite

您能帮我解决这里的问题吗?

Could you please help me with whats the problem here?

预先感谢, 斯里尼.

推荐答案

您的phpinfo表未显示PDO部分和pdo_mysql部分,这意味着您尚未安装pdo. //i.stack.imgur/srmRk.png"alt =" phpinfo>

your phpinfo table not showing PDO section and pdo_mysql section that means you have not installed pdo.Like my phpinfo showing..see image

更多推荐

升级到php 5.3.x后找不到PDO类致命错误

本文发布于:2023-05-29 03:33:29,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/335810.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:词库加载错误:Could not find file &#039;D:\淘小白 高铁采集器win10\Configuration\Dict_Sto

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!