在文件系統上查找php\ext\php_mysqli.dll
(這是安裝xampp的路徑)。只有PHP需要這個模塊,Apache只需要執行PHP。所以檢查你有沒有
extension=php_mysql_libmysql.dll
在php\php.ini
。隨着MySQL的
[MySQLi]
mysqli.allow_local_infile = On
mysqli.allow_persistent = Off
mysqli.cache_size = 2000
mysqli.max_persistent = -1
mysqli.max_links = -1
mysqli.default_port = 3306
...
一個配置部分,你在嘗試使用mysqli_query()
等功能有哪些誤區?
如果你真的無法正常工作,excellend和xampp會在你選擇的操作系統上安裝完整的* AMP堆棧,而且很少麻煩。
編輯: @Beauford如果函數未定義,那麼庫不加載。遵循以上的MySQLi說明,如果這仍然不起作用與一個或許有關Win7的troubleshooting guide in the comments沿here(原始拷貝)包安裝步驟:
to enable the mysql_... and mysqli_... functionality, i opened the php.ini file to uncomment the following lines:
;extension=php_mysql.dll
;extension=php_mysqli.dll
;extension=php_pdo_mysql.dll
but phpinfo() still stated that no mysql extensions were loaded. i tried the fixes and suggestions above with no success. so i invoked the windows shell and typed ("Path" environment variable set to the PHP & MySQL directories): php.exe -m
this returned the following error: PHP Startup: Unable to load dynamic library 'C:\php5\php_mysql.dll' - Module not found.
this told me that PHP didn't recognize what i thought was the extensions directory. it searched all other places first (sys-dir, workin'-dir, the MySQL "bin" dir because of the "Path" variable set, and even a curious directory "C:\php5" that doesn't even exist on my mashine) but not the expected "ext" directory.
so the fix was to go to "php.ini" again and uncomment the following line:
;extension_dir="ext"
我種需要的不僅僅是更多的細節「它不工作'。你的php.ini配置是什麼樣的?你有沒有extension = php_mysql.dll extension = php_mysqli.dll uncommented? – Paul 2010-11-23 02:02:08
WAMP是無憂無慮的 - 有一個插件,允許您在MySQL版本之間切換。我也推薦toad for mysql :) – 2010-11-23 02:42:23