17DST→一起创造价值's Archiver

暖冬 发表于 2008-4-26 00:13

新配置环境安装DZ6.1提示“服务器不支持 MySql 数据库,无法安装论坛程序”的解决方法

环境配置如下:
Apache 2.2.8
PHP 5.2.5
MySQL 6.0.4
Zend 3.3.3
系统 Win XP SP2
配置完成后,安装DZ6.1,出现提示:“服务器不支持 MySql 数据库,无法安装论坛程序”,导致无法继续安装论坛程序!
网上查找了很多内容,方法就两三种,基本都修改了很多内容;
其实只需要三步就可以了:
1. 去除 php.ini 文件中 ;extension=php_mysql.dll 前的分号(;)
2. 修改php.ini 文件中 ;extension_dir = "./" 为 extension_dir = "X:/php的路径(如果有多重路径则之间用【/】分割;当然全部用【\】也是可以的)/ext"。此处最好的/ext后面不可以有【/】或【\】
3. 拷贝 php 目录下的  libmysql.dll  文件到系统的 system32目录下;
通过以上三步问题就可以解决了!!
关于第三步:
参看 [url]http://cn2.php.net/manual/en/mysql.installation.php[/url] 手册关于windows php5+ 安装部分;
[quote]Installation on Windows Systems
PHP 4
The PHP MySQL extension is compiled into PHP.

PHP 5+
MySQL is no longer enabled by default, so the php_mysql.dll DLL must be enabled inside of php.ini. Also, PHP needs access to the MySQL client library. A file named libmysql.dll is included in the Windows PHP distribution and in order for PHP to talk to MySQL this file needs to be available to the Windows systems PATH. See the FAQ titled "How do I add my PHP directory to the PATH on Windows" for information on how to do this. Although copying libmysql.dll to the Windows system directory also works (because the system directory is by default in the system's PATH), it's not recommended.

As with enabling any PHP extension (such as php_mysql.dll), the PHP directive extension_dir should be set to the directory where the PHP extensions are located. See also the Manual Windows Installation Instructions. An example extension_dir value for PHP 5 is c:\php\ext

Note: If when starting the web server an error similar to the following occurs: "Unable to load dynamic library './php_mysql.dll'", this is because php_mysql.dll and/or libmysql.dll cannot be found by the system.
[/quote]
以上文字大意为:
php4 已经集成了 MySQL扩展;
PHP5 默认是不启用Mysql的;libmysql.dll 的目的时要 PHP 告诉 MySQL 此文件需要在 windows 系统的路径(环境变量的PATH【设置方法:我的电脑---》点击右键,选择属性---》高级 标签---》环境变量 按钮---》PATH】)里面可用 !!
最后还有一个提别提醒:当WEB服务器产生类似不能加载php_mysql.dll文件的错误时,是因为php_mysql.dll 或 libmysql.dll不能被系统找到!!
基于此原因,只要 libmysql.dll 能够被系统在 环境变量的 PATH 里面找到就可以!

页: [1]

Powered by Discuz! Archiver 7.0.0  © 2001-2009 Comsenz Inc.