当前位置:Gxlcms > PHP教程 > php和mysql5.5的整合解决思路

php和mysql5.5的整合解决思路

时间:2021-07-01 10:21:17 帮助过:21人阅读

php和mysql5.5的整合
php.ini:
extension_dir = "C:/phpenv/php-5.2/ext"
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_bz2.dll
extension=php_gd2.dll

php文件:
$link = mysql_connect('localhost', 'root', 'root');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>


apache error.log:
PHP Fatal error: Call to undefined function mysql_connect() in C:\\phpenv\\Apache2.2\\htdocs\\testmysql.php on line 2

请问是怎么回事啊?

------解决方案--------------------
phpinfo();
检查php.ini 路径是否是修改过的文件.

人气教程排行