Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Nov 2011
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Class 'mysqli' not found

    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):

    Code:
    ;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:

    Code:
    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!!

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,980
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    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.

  • #3
    New Coder
    Join Date
    Nov 2011
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,980
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    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?

  • #5
    New Coder
    Join Date
    Nov 2011
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Fou-Lu View Post
    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

  • #6
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,980
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    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.

  • #7
    New Coder
    Join Date
    Nov 2011
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •