zend debug mysql_connect()

本文提供了一个针对Windows平台下使用Zend Studio进行PHP5调试时遇到mysql_connect()错误的解决方案。主要步骤包括:确认PHP版本,下载对应版本的PHP包,提取所需的libmysql.dll和php_mysql.dll文件,并将它们放置在正确的位置;修改php.ini文件以加载正确的扩展。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

使用zend调试,会出现 mysql_connect() 错误,网上找的一个解决方法


SOME IMPORTANT NOTICES:
- This applies only to Windows users
- I have written this solution for php5 users. If you are using php4, follow the instructions, just that use php4 instead of php5 at the paths used at steps 6 and 7
- The solution is particulary good for mysql_connect() error issue. If you have problems with other php extensions (Ex. socket_create error), do the same, but proceed analogically regarding to the .dll files needed
- Good Luck

HERE'S WHAT YOU NEED TO DO
1. Find the PHP version that Zend is running (a phpinfo() would be usefull)
2. Download the appropiate version from www.php.net
3. Find the files in the package: libmysql.dll in the root path and php_mysql.dll in the ext/ path
4. Extract them to a temporary folder
5. Place your libmysql.dll in the {LOCAL_DRIVE}:/WINDOWS/system32/
6. Place your php_mysql.dll in the zend extensions folder. This can be anywhere, but I strongly reccomend that you put it into {PATH_TO_ZEND_STUDIO}/bin/php5/ext/
7. Find the php.ini used by Zend. This is ussualy in {PATH_TO_ZEND_STUDIO}/bin/php5/
8. Open the php.ini with a text editor, and add the following to lines at the end

*************************************************************
Code:

extension_dir=PATH_TO_EXTENSIONS_FOLDER
extension=php_mysql.dll
*************************************************************

PATH_TO_EXTENSIONS_FOLDER should be {PATH_TO_ZEND_STUDIO}/bin/php5/ext/ (as i've told you above), or the path to your php_mysql.dll, in case that you put it elsewhere.
NOTICE: The path must be a FULL path

9. Save the php.ini
10. Run the debugger
11. Have fun

 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值