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

Here's an SO thread with some tips. What version of WAMP are you using? Is there perhaps an another PHP.INI getting in the way?

Here's an SO thread with some tips. What version of WAMP are you using? Is there perhaps an another PHP.INI getting in the way?

I'm using 5.3+. And it's wamp 2.0. I know I don't need that file for the version that I have. Buuut everytime I view the Apache error logs, it throws this:

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

Which has nothing to do with the mysqli class.
How do you know if there is another php.ini in the way?...

Member Avatar for diafol

How do you know if there is another php.ini in the way?...

search for php.ini or variants thereof. I've seen php5.ini and I think php-win.ini Stuff like that. Try renaming them one at a time to see if the problem resolves itself.

How do you know if there is another php.ini in the way?...

search for php.ini or variants thereof. I've seen php5.ini and I think php-win.ini Stuff like that. Try renaming them one at a time to see if the problem resolves itself.

No there isn't. I checked all php.ini in my whole C: drive and it's all related to WAMP inside of that folder.

Do I need to change the Windows include_path to something specific in php.ini?

try this..

copy, paste to notepad, save as anyNameYouWant.php, upload to your htdocs .

<?php phpinfo(); ?>

Direct your favorite browser to anyNameYouWant.php, and look for Loaded Configuration File , or Configuration File (php.ini) Path

Now the fun part, look for the location of the php.ini file and edit it.. For example, wamp/php/php.ini .However, your case might have a different location, because you already stated above you already edited the php.ini file inside your php directory.

The loaded configuration file is like so:

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

I have the extension_dir like this:

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

Which that leads to the mysqli and mysql dll files.

I have these enabled by deleting the ";":

extension=php_mysql.dll
extension=php_mysqli.dll

Is there anything else I would need to change in there?

Hi,

On your extension directory, look for the .dll files. Make sure that you are editing the php.ini file from the loaded configuration file.

If this does not work for you, then you must set the cofig file to php/php.ini, and then you copy the .dll files from the php5.3.9/ext/ dir to php/ext directory.

You should have a .dll file named php_mysql.dll in there.,

Depending on your OS, if running on window (all versions) the server configuration file is located in apache/conf directory. For the ubuntu and other distros powering desktops the configuration file is located in etc directory.


Don't forget to restart your server everytime entries are modified...

Another suggestion, you can use xampp which is already pre-configured to run mysqli, pdo.

Xampp can and will also run from portable drive..

A simple portable drive xampp installation
1. Download xampp for your OS
2. Extract zip file contents to your portable drive.
3. Open portable drive, look for the xampp_start.exe to start the service.

That's all you need to do. Everything are pre-configured for you. Just dump your php script in the htdocs directory.

Another suggestion, you can use xampp which is already pre-configured to run mysqli, pdo.

Xampp can and will also run from portable drive..

A simple portable drive xampp installation
1. Download xampp for your OS
2. Extract zip file contents to your portable drive.
3. Open portable drive, look for the xampp_start.exe to start the service.

That's all you need to do. Everything are pre-configured for you. Just dump your php script in the htdocs directory.

Do you know if it's possible to do that with EasyPHP as well? EasyPHP looks like a good local web server. Or is Xampp better?

Member Avatar for diafol

Used EasyPHP a few years ago as a usb drive solution. I think that XAMPP also now offers this. XAMPP used to be much better than it, but I think Easy has sorted itself out recently with more recent versions in the stack. Most of the documentation used to be in French too, but again this seems to have been updated lately.

I think XAMPP is a pretty standard stack, with a lot of support for it. You need to compare the stack contents, any add-ons, componenets or modules you may need. How does the documentation compare? Have a look at the FAQs and Forums.

At the time of writing, XAMPP's latest Windows download was boasting php5.3.8 while Easy was including 5.4RC's in some downloads. So it seems Easy may be edging XAMPP with regard to staying current/bleeding edge, but that ain't the be-all and end-all.

Do you know if it's possible to do that with EasyPHP as well? EasyPHP looks like a good local web server. Or is Xampp better?

Either one will make your development a lot easier... you can spend more time writing codes than trying to figure out your server configurations.

I am also using EasyPHP.. it all depends on what you are trying to write. If you will be developing an application in which ffmpeg, mencoder, mp4box, and flvtool2 are needed to be executed by the php script, then xampp is more flexible and accommodating for this type of applications.

Outside the youtube like development, I think EasyPHP got the upper hand, because it has more modules to offer for the most commonly develop applications such as joomla and presta shop ( I worked on some of modules and extension for this), just to name a few.

**thank you veedeo!!! **

"Hi,

On your extension directory, look for the .dll files. Make sure that you are editing the php.ini file from the loaded configuration file.

If this does not work for you, then you must set the cofig file to php/php.ini, and then you copy the .dll files from the php5.3.9/ext/ dir to php/ext directory.

You should have a .dll file named php_mysql.dll in there.,

Depending on your OS, if running on window (all versions) the server configuration file is located in apache/conf directory. For the ubuntu and other distros powering desktops the configuration file is located in etc directory.

Don't forget to restart your server everytime entries are modified..."

that fixed it for me...thanks so much...its been hours and finally....I wish I knew why but for now that is good enough:) ur awesome!!!!

hi, i install mysql and apache and php seprate

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.