php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33481 Fatal error: Class 'mysqli' not found in /path/file.php line #
Submitted: 2005-06-26 17:13 UTC Modified: 2005-06-26 18:55 UTC
From: qjahe at videotron dot ca Assigned:
Status: Not a bug Package: MySQLi related
PHP Version: 5CVS-2005-06-26 (dev) OS: Debian 3.1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: qjahe at videotron dot ca
New email:
PHP Version: OS:

 

 [2005-06-26 17:13 UTC] qjahe at videotron dot ca
Description:
------------
CVS Built On: Jun 26, 2005 14:30 GMT

Used the same configure command for php 5.0.3 and mySQLi was working fine. I am kind of a noob so I havent really touched my config AT ALL on my server.

It compiled with no errors...
Dont know what i'm doing wrong I've been told to report it here.

Fatal error: Class 'mysqli' not found in /path/file.php line #
each time I tried to instantiate mySQLi...

Again it was working fine with the same exact setup/server with the version 5.0.3.

Reproduce code:
---------------
./configure --disable-debug --enable-pic --disable-rpath --enable-inline-optimization --with-db4=/usr --with-curl --with-dom=/usr --with-exec-dir=/usr/bin --with-png-dir=/usr --with-gd --enable-gd-native-ttf --with-ttf --with-gettext --with-ncurses --with-gmp --with-iconv --with-jpeg-dir=/usr --with-openssl --with-png --with-pspell --with-regex=php --with-xml --with-expat-dir=/usr --with-pcre-regex=/usr --with-zlib --with-layout=GNU --enable-bcmath --enable-exif --enable-ftp --enable-magic-quotes --enable-safe-mode --enable-sockets --enable-sysvsem --enable-sysvshm --enable-discard-path --enable-track-vars --enable-trans-sid --enable-yp --enable-wddx --enable-mbstr-enc-trans --enable-mbregex --without-oci8 --with-pear=/usr/share/pear --with-imap-ssl --with-kerberos=/usr/kerberos --with-ldap=shared --with-mysqli=shared,/usr/bin/mysql_config --enable-memory-limit --enable-bcmath --enable-shmop --enable-calendar --enable-dbx --enable-dio --enable-mcal --without-bz2 --disable-short-tags --disable-pear --disable-cgi --with-apxs2=/usr/bin/apxs2


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-26 17:37 UTC] tony2001@php.net
--with-mysqli=shared,/usr/bin/mysql_config

And what does your phpinfo() tell about MySQLi ?
Didn't you forget to turn it on in your php.ini ?
 [2005-06-26 18:03 UTC] qjahe at videotron dot ca
I might of forgot to, but I assumed that putting the directive --with-mysqli=shared,/usr/bin/mysql_config would put it on in the php.ini

Like I said i'm a bit of a newb and dont know how to "turn it on" in the php.ini. I tried doing a bit of research on the php.net site for "mysqli php.ini" but nothing pointing out how to "turn mySQLi on" in the php.ini.

What should I be looking for? I see almost a duplicated of the [MySQL] section except for [MySQLi], does that mean its on?
 [2005-06-26 18:55 UTC] johannes@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

add an extension=mysqli.so line to your php.ini or remove 
the "shared," part from your configure line... 
 [2014-08-08 03:59 UTC] wwdunlap2009 at hotmail dot com
add an extension=mysqli.so line to your php.ini or remove 
the "shared," part from your configure line this did not work.
Developer is crazy.

The docroot="C:\Program files\PHP" in the php.ini got rid of the input file can not be found. but now it can't find the php file on the server due to paths or 
bad fact_cgi path setup.  It has something to do with paths in the beginning to
move forward on this. Developer is not finding out why classes can't be accessed
from the mysql database and leaving this php install and mysql install broken for php script runs why?

Some type of path or fast_cgi problem when running php -m it fails when running as administrator. Have fixed errors when running as php -m.  Now phpinfo.php shows up. But I can't get the mysql database classes to run right in the database. fatal errors trying to use certain php classes that run in php. Developer is a shit head since setup for mysql and php don't see the right phpmysql.dll or libmysql.dll for apache or php and the install fails. Anyone can say its not a bug and just ignore bad paths that are setup and cause this error.  PATH and SCRIPTNAME for fast cgi is broken and developer is an idiot. Fails at install due to bad paths or scripts in php. php fails with path errors or library errors due to wrong files setup for php installation.  Wondering how to figure out what exactly is run when you run a php script.  Where does it go to run a php script so I can fix the paths and files it uses to access the mysqli class run in the mysql database is the question here for php connect to get data from the database using the class mysqli_connect?  This will fix this bug?

here is the code that fails.

<?php # CONNECT TO MySQL DATABASE.

# Connect  on 'localhost' for user 'mike' with password 'easysteps' to database 'site_db'.
$dbc = @mysqli_connect ( 'localhost', 'mike', 'easysteps', 'site_db' ) //<------fails on this line above due to trying to use a mysqli_connect command in mysql in the database from php

# Otherwise fail gracefully and explain the error. 
OR die ( mysqli_connect_error() ) ;

# Set encoding to match PHP script encoding.
mysqli_set_charset( $dbc, 'utf8' ) ;

Can someone tell me where it goes to run this script step by step and what it needs set for paths or in a batch file to get php working on a server? The install fails because php is not addressing bad paths or files need to run php!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 01:01:28 2024 UTC