使用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
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