mike_abc Posted April 18, 2012 Share Posted April 18, 2012 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 Quote Link to comment https://forums.phpfreaks.com/topic/261170-fatal-error-class-msqli-not-found/ Share on other sites More sharing options...
trq Posted April 18, 2012 Share Posted April 18, 2012 Your posts mentions mssql and mysql interchangeably. Please clarify. Quote Link to comment https://forums.phpfreaks.com/topic/261170-fatal-error-class-msqli-not-found/#findComment-1338398 Share on other sites More sharing options...
AyKay47 Posted April 18, 2012 Share Posted April 18, 2012 1. make sure the relevant socket was created successfully. 2. make sure the proper directive is enabled for the mysqli lib in the php.ini Quote Link to comment https://forums.phpfreaks.com/topic/261170-fatal-error-class-msqli-not-found/#findComment-1338403 Share on other sites More sharing options...
mike_abc Posted April 18, 2012 Author Share Posted April 18, 2012 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 ? 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 Quote Link to comment https://forums.phpfreaks.com/topic/261170-fatal-error-class-msqli-not-found/#findComment-1338406 Share on other sites More sharing options...
AyKay47 Posted April 18, 2012 Share Posted April 18, 2012 1. make sure the socket exists. 2. inside of the php.ini, make sure that the directive extension=php_mysqli.dll is enabled. I believe it is disabled by default. Quote Link to comment https://forums.phpfreaks.com/topic/261170-fatal-error-class-msqli-not-found/#findComment-1338411 Share on other sites More sharing options...
mike_abc Posted April 18, 2012 Author Share Posted April 18, 2012 AyKay47: Thanx, but... .dll ? it's not Windows, its Ubuntu ! And how do I "make sure" the socket exists ? I don't even know what a socket IS ! (Sorry). Mike Quote Link to comment https://forums.phpfreaks.com/topic/261170-fatal-error-class-msqli-not-found/#findComment-1338415 Share on other sites More sharing options...
mike_abc Posted April 18, 2012 Author Share Posted April 18, 2012 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 ? Quote Link to comment https://forums.phpfreaks.com/topic/261170-fatal-error-class-msqli-not-found/#findComment-1338421 Share on other sites More sharing options...
trq Posted April 18, 2012 Share Posted April 18, 2012 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 Quote Link to comment https://forums.phpfreaks.com/topic/261170-fatal-error-class-msqli-not-found/#findComment-1338422 Share on other sites More sharing options...
AyKay47 Posted April 18, 2012 Share Posted April 18, 2012 AyKay47: Thanx, but... .dll ? it's not Windows, its Ubuntu ! then extension = "mysqli.so" Quote Link to comment https://forums.phpfreaks.com/topic/261170-fatal-error-class-msqli-not-found/#findComment-1338425 Share on other sites More sharing options...
mike_abc Posted April 18, 2012 Author Share Posted April 18, 2012 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 Stupid but "nothing-out-of-the-ordinary" mistake. Should've posted my code (which is quite long). Mike Quote Link to comment https://forums.phpfreaks.com/topic/261170-fatal-error-class-msqli-not-found/#findComment-1338429 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.