快崩溃了,我安装PHP+MYSQL环境竟然不行.谁帮帮我啊,

yunanyunan 2006-09-28 10:45:17
服务器
win2003


地址:http://bbs.hongliu.org/123.php PHP信息显示PHP安装没有问题了

http://bbs.hongliu.org/install/install.php 安装动网PHP就不行.
用户名root 密码:123

那位大哥远程帮我看看啊.
...全文
371 点赞 收藏 35
写回复
35 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
wfyfngu 2006-09-28
扩展的库是放在\ext目录下的
默认的配置文件是认为他们在同一级目录下
所以去掉分号还是找不到文件,估计要在前面加上目录名
extension = ext\php_mysql.dll
回复
yunanyunan 2006-09-28
谢谢,哈,现在好了,
iasky(C#_ASP_PHP) 说的对,dvbbs的配置文件没有设置好,
谢谢lzkd(浪子快刀) (

我马上给分.
太感谢你们了.谢谢.
回复
yunanyunan 2006-09-28
为了迎接dvphp公测,特发此教程,希望对一些不会的朋友有所帮助,希望会的朋友多多指教!



下面的教程都是在windows 2000下实现的,其他系统请自己参照修改, 2003的系统请把winnt修改成windows.

操作系统目录:c:\winnt
PHP默认安装目录:C:\php
PHP版本:PHP 4.3.10 下载地址:http://www.php.net/downloads.php (Windows Binaries)
Mysql版本:mysql-4.0.22-win 下载地址:http://dev.mysql.com/downloads/
zend :Zend Optimizer v2.5.5 (可选安装)

首先将php压缩包解压到c:\php目录下,
先 php.ini-dist改名为php.ini
然后 php.ini 和php.exe复制到winnt目录...
php4ts.dll和php4isapi.dll(这个在sapi目录中)复制到winnt/system32 目录..........


*************************************

好象没有说支持到什么版本,
这个是官网的帖子,是不是我的PHP版本太高了
回复
iasky 2006-09-28
'dvbbs'@'localhost'

用的MySql用户名是这个?

是不是配置文件不可写?
回复
lzkd 2006-09-28
那,应该是动网的那个BBS的问题了那个安装版本是支持什么版本的php+mysql
回复
yunanyunan 2006-09-28
晕,虽然文件内容:
<?php
if(!Mysql_connect("localhost","root","123456789"))
echo "连接数据库失败";
elseif(!Mysql_select_db("mysql"))
echo "打开数据库失败";
else
echo 'ok';
?>
显示OK了.DVBBS还是装不上,还是提示:
Dvbbs.php info: Can not connect to MySQL server
php_errormsg:
The URL Is: http://bbs.hongliu.org/install/install.php?language=sc_gbk&setupaction=chkenvironment
Errno: 1045
Error: Access denied for user 'dvbbs'@'localhost' (using password: YES)
You Can Get Help In: http://bbs.cndw.com
回复
yunanyunan 2006-09-28
哈哈,终于OK 了!!!

http://bbs.hongliu.org/sql.php
回复
yunanyunan 2006-09-28
呵呵,还是不行,
libmysql.dll拷过去了,

IIS也重起了N次.

MYSQL服务、也重起了.

php.ini 也修改了.
真的只有汗一个..
会不会和我的WIN2003 是盗版有关.
回复
lzkd 2006-09-28
iis或者apache重新起动没有?
回复
yunanyunan 2006-09-28
修改好了. 好象还是不行

[MySQL]
; Allow or prevent persistent links.
mysql.allow_persistent = On

; Maximum number of persistent links. -1 means no limit.
mysql.max_persistent = -1

; Maximum number of links (persistent + non-persistent). -1 means no limit.
mysql.max_links = -1

; Default port number for mysql_connect(). If unset, mysql_connect() will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order). Win32 will only look
; at MYSQL_PORT.
mysql.default_port = 3306

; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
mysql.default_socket =

; Default host for mysql_connect() (doesn't apply in safe mode).
mysql.default_host = localhost

; Default user for mysql_connect() (doesn't apply in safe mode).
mysql.default_user = root

; Default password for mysql_connect() (doesn't apply in safe mode).
; Note that this is generally a *bad* idea to store passwords in this file.
; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password")
; and reveal this password! And of course, any users with read access to this
; file will be able to reveal the password as well.
mysql.default_password = 123456789

; Maximum time (in secondes) for connect timeout. -1 means no limit
mysql.connect_timeout = 60

; Trace mode. When trace_mode is active (=On), warnings for table/index scans and
; SQL-Errors will be displayed.
mysql.trace_mode = Off
回复
lzkd 2006-09-28
数据库中默认有两个数据库
一个MYSQL
一个test
我现在改成 elseif(!Mysql_select_db("mysql")) 了
还是不能连接.

*******

楼主的MYSQL没有正常打开.参考我上面的话.还有有一个文件libmysql.dll有没有拷贝到system32目录下了.

如果这些都做了,还是不成.那....汗一个
回复
lzkd 2006-09-28
还是怀疑你的PHP没配置正确,检测php.ini里如下内容,我有做中文标注的地方跟着改
[MySQL]
; Allow or prevent persistent links.
mysql.allow_persistent = On

; Maximum number of persistent links. -1 means no limit.
mysql.max_persistent = -1

; Maximum number of links (persistent + non-persistent). -1 means no limit.
mysql.max_links = -1

; Default port number for mysql_connect(). If unset, mysql_connect() will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order). Win32 will only look
; at MYSQL_PORT.
;mysql端口号
mysql.default_port = 3306

; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
mysql.default_socket =

; Default host for mysql_connect() (doesn't apply in safe mode).
;mysql主机
mysql.default_host = localhost

; Default user for mysql_connect() (doesn't apply in safe mode).
;用户名
mysql.default_user = root

; Default password for mysql_connect() (doesn't apply in safe mode).
; Note that this is generally a *bad* idea to store passwords in this file.
; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password")
; and reveal this password! And of course, any users with read access to this
; file will be able to reveal the password as well.
;密码
mysql.default_password = 123456789

; Maximum time (in secondes) for connect timeout. -1 means no limit
mysql.connect_timeout = 60

; Trace mode. When trace_mode is active (=On), warnings for table/index scans and
; SQL-Errors will be displayed.
mysql.trace_mode = Off
回复
yunanyunan 2006-09-28
数据库中默认有两个数据库
一个MYSQL
一个test
我现在改成 elseif(!Mysql_select_db("mysql")) 了
还是不能连接.
回复
lzkd 2006-09-28
elseif(!Mysql_select_db("wear"))
这句是连接库..应该是

elseif(!Mysql_select_db("dvbbs")) //或者DVBBS这要看你建库的名字了
回复
yunanyunan 2006-09-28
改了,我现在建了两个用户
一个root
一个DVBBS
密码都是123456789
回复
yunanyunan 2006-09-28
是不是我的数据库中必须有 wear 这个数据表啊
回复
lzkd 2006-09-28
晕...楼主连用户名,密码,数据库都不改一下就直接用了...大汗..就我修改过的那段代码
回复
yunanyunan 2006-09-28
天,居然是失败,难道是我的PHP安装不对,

回复
yunanyunan 2006-09-28
http://bbs.hongliu.org/sql.php


文件内容:
<?php
if(!Mysql_connect("localhost","root","123456789"))
echo "连接数据库失败";
elseif(!Mysql_select_db("wear"))
echo "打开数据库失败";
else
echo 'ok';
?>
回复
lzkd 2006-09-28
根据你的情况修改一下

<?php
if(!Mysql_connect("localhost","dvbbs","123456789"))
echo "连接数据库失败";
elseif(!Mysql_select_db("dvbbs")) //mysql5是否支持数据库名大写?
echo "打开数据库失败";
else
echo 'ok';
?>
回复
发帖
基础编程
创建于2007-09-28

2.1w+

社区成员

从PHP安装配置,PHP入门,PHP基础到PHP应用
申请成为版主
帖子事件
创建了帖子
2006-09-28 10:45
社区公告
暂无公告