Jump to content

Fatal error: Class 'msqli' not found


Recommended Posts

I almost feel embarassed to ask this question !

 

I installed LAMP thru Synaptic Package Manager (or sudo apt-get install, I don't remember well) on an Ubuntu 10.04 LTS development server.

i am trying to build a web app which uses PHP & MySQL (dynamic pages).

 

When I try to query MySQL from within <?php .. ?> in <filename> , I get the 

 

Fatal error: Class 'msqli' not found in <filename>.

 

PHP works, PHPMyAdmin works, I set the msqli.default_socket parameter to /var/run/mysqld/mysqld.sock (without "") in the /etc/php5/apache2/php.ini file as per phpinfo() - still it doesn't work !

 

Why the heck doesn't it ?! What else should I do ?

 

 

Remark: the user which queries MySQL has been defined (it is not "me", the Ubuntu user) and has SELECT granted on all tables in the Database.

 

Thanks,

 

Mike

 

Link to comment
Share on other sites

Thorpe: I don't see mssql, but since its LAMP, its MySQL (several times). MySQL, for sure.

 

AyKay47: Thanks, but how do I do what you suggest ?  :shrug:

 

What is the "proper directive" ? I changed msqli.default-socket. I checked afterwards in phpinfo().

And how do I make sure about the socket ?

 

I am quite new with LA.P (databases I know well).

 

Mike

 

Link to comment
Share on other sites

Ok, solved. It was a typo in my code, quite stupid. Sorry for wasting your time !

There's not even such a thing as msqli - only mysqli. That's all.

 

PS. In Ubuntu, instead of php_mysqli.dll, there's a mysqli.so, just for the record.

 

Thanks everybody for their help.

 

Mike

 

How do I mark this as solved ?

Link to comment
Share on other sites

I don't see mssql, but since its LAMP, its MySQL (several times). MySQL, for sure.

 

What? Read the topic of your thread.

 

Did you install the mysqli extension when you installed PHP? PHP is not a single package but is made up of many different packages.

 

I haven't used Debian (or Ubuntu) in a while, but it would be php-mysqli or similar.

 

apt-get install php-mysqli

Link to comment
Share on other sites

Yes, I had installed php-mysqli.

 

I only had a typo in my code when calling mysqli, as I explained in my latest post: msqli instead of mysqli  :shrug:

Stupid but "nothing-out-of-the-ordinary" mistake.

 

Should've posted my code (which is quite long).

 

Mike

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.