使用PHP和Apache连接到MYSQL [英] connecting to MYSQL using PHP and Apache

查看:93
本文介绍了使用PHP和Apache连接到MYSQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试配置PHP来运行MYSQL并且它不起作用。我花了很多时间试图解决这个问题。我已经对php.ini文件和httpd.conf文件进行了更改,它不再给我一个错误,但它仍然没有连接到数据库。它在mysql_connect语句之前,它说即将连接,然后而不是错误消息,我什么也得不到。它只是坐在那里。

I trying to configure PHP to run MYSQL and it isn''t working. I''ve spend many hours trying to figure this out. I''ve made changes to the php.ini file and the httpd.conf file and it no longer gives me an error, but it still doesn''t connect to the database. It gets to right before the mysql_connect statement where it says "about to connect", and then instead of the error message, I get nothing. It just sits there.

展开 | 选择 | Wrap | 行号

推荐答案

你检查了phpinfo的输出吗? ()函数用于MySQL信息?
Have you checked the output of the phpinfo() function for the MySQL info?


是的。可能是因为我有Windows XP和phpinfo说我有Windows NT ???
yes nothing there. could it be because I have windows XP and the phpinfo says I have windows NT???


不,Windows XP使用NT内核,所以这是正常的。


确保您已完成以下所有操作:
  • 删除;来自php.ini中的''; extension = php_mysql.dll''
  • 从PHP根目录添加文件''libmysql.dll''到PATH环境变量。或者只是将文件复制到你的windows目录。
  • 重新启动apache服务器。
No, Windows XP uses the NT kernel, so that''s all normal.

Make sure you''ve done all the following:
  • Remove the ; from the line '';extension=php_mysql.dll'' in php.ini
  • Add the file ''libmysql.dll'', from your PHP root dir, to the PATH enviroment variable. Or just copy the file to your windows directory.
  • Restart the apache server.


这篇关于使用PHP和Apache连接到MYSQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆