...

View Full Version : Class 'mysqli' not found



lilmousiee
02-27-2012, 12:35 AM
Ok I researched EVERYWHERE on the Internet and I just can't get this to work.

In my php.ini under my WAMP php folder, I have this (enabling the extensions):


;extension=php_mssql.dll
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8.dll
;extension=php_oci8_11g.dll
;extension=php_openssl.dll

Error:


Fatal error: Class 'mysqli' not found in C:\wamp\www\Elvonica\class\Database.php on line 11

I have both the .dll's enabled.
And then there is this crazy libmysqli.dll or something you're suppose to put somewhere.. I searched my whole C:/ directory for that file and it didn't find anything. I even searched for "lib" "mysql". Nothing. :/
Then they said phpinfo(); should have a MySqlI section and I can't find any so I have a feeling I don't even have mysqli extension or something. But when I look under the ext folder in the php folder of WAMP, both files are there and I have them enabled in the php.ini.

So what am I doing wrong? Thank you soooo much for anyone who can help me solve this!!

Fou-Lu
02-27-2012, 02:24 AM
libmysql.dll isn't required as of 5.3+. If you are on a 5.3+ system then it is not required.
Has the path to your PHP installation directory been added to the system path? All ext needs is php_mysqli.dll.
Check the apache error logs. During startup it will likely trigger an error indicating that it cannot find / load php_mysql.dll.

lilmousiee
03-01-2012, 05:34 PM
Yes I have 5.3+. I know you don't need that file anymore. Is that why I can't find it anywhere on my C: drive?
And how do you check your system path? Which file is that in? php.ini?

The only error the Apache error log is throwing is this:

[Thu Mar 01 12:31:57 2012] [error] [client 127.0.0.1] File does not exist: C:/wamp/www/favicon.ico

Fou-Lu
03-01-2012, 05:42 PM
System path is an OS directive. You can check your environment or echo %PATH% on a CLI.

Run a phpinfo() and look for the loaded php.ini. Is that the one you have modified?
Also, as daft as this may sound I assumed you restarted apache after the change?

lilmousiee
03-02-2012, 03:44 AM
System path is an OS directive. You can check your environment or echo %PATH% on a CLI.

Run a phpinfo() and look for the loaded php.ini. Is that the one you have modified?
Also, as daft as this may sound I assumed you restarted apache after the change?

Yes the one I have is this:

Loaded Configuration File C:\wamp\bin\apache\Apache2.2.21\bin\php.ini

And that php.ini file in the Apache bin looks like this:


; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"
;
; PHP's default setting for include_path is ".;/path/to/php/pear"
; http://php.net/include-path


That's the include_path stuff. I don't know what to do there.
But here is the extensions as well:


;extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_dba.dll
extension=php_mbstring.dll
;extension=php_exif.dll
;extension=php_fileinfo.dll
extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
;extension=php_ming.dll
;extension=php_mssql.dll
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8.dll
;extension=php_oci8_11g.dll
;extension=php_openssl.dll
;extension=php_pdo_firebird.dll
;extension=php_pdo_mssql.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_phar.dll
;extension=php_pspell.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_soap.dll
;extension=php_sockets.dll
;extension=php_sqlite.dll
;extension=php_sqlite3.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll
;extension=php_zip.dll

Fou-Lu
03-02-2012, 02:13 PM
include_path does not require configuring. What of extension_dir, is that pointing at the path to PHP extensions?
also, you haven't verified that the apache has been restarted.

lilmousiee
03-04-2012, 04:40 PM
In the php.ini file, the extension_dir is pointing towards this:


extension_dir = "c:/wamp/bin/php/php5.3.9/ext/"

I checked the ext directory inside the php5.3.9 folder and it has the mysqli and mysqli dll files in there. Sooooo I don't know. :/ Everything seems to be working well, but it won't find it for some odd reason.

And yes, I restarted Apache. Well I restarted Wamp services.. I think that would restart Apache as well.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum