php和mysql5.5的整合解决思路
程序员文章站
2022-06-10 23:12:31
...
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 路径是否是修改过的文件.
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 路径是否是修改过的文件.
相关文章
相关视频
上一篇: 一个很方便的 XML 类