cougar23 Posted May 6, 2008 Share Posted May 6, 2008 I'm trying to test the mysqli functionality so I can start developing. I put in some basic code: <?php //establish MySQL connection $db = new mysqli('localhost', 'admin', 'admin', 'mydatabase'); //if connection failed, exit file if(mysqli_connect_errno()) exit; else echo 'connection established'; ?> And when the page loads I'm getting the error: Fatal error: Class 'mysqli' not found in C:\Apache2.2\htdocs\sportsdata\index.php on line 22 I've set the extension_dir to "C:\PHP\ext" and uncommented the "extension=php_mysqli.dll" line in php.ini, restarted the server (I'm in Windows Vista environment), and still get the error. Other info from phpinfo() that might help in your replies are: Configuration File (php.ini) Path -- C:\Windows Loaded Configuration File -- C:\PHP\php.ini extension_dir -- C:/PHP/ext include_path -- .;C:\php5\pear **no listed Additional Modules** I'm sure i'm missing something basic, but I'm transitioning over to PHP from Java. Thanks in advance for you time and help. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted May 7, 2008 Share Posted May 7, 2008 From the mysqli installation section in the php manual - Also, PHP needs access to the MySQL client library. A file named libmysql.dll is included in the Windows PHP distribution and in order for PHP to talk to MySQL this file needs to be available to the Windows systems PATH. The best way to correct this is to add C:/PHP to the Windows PATH statement (reboot or log off/log on to your Windows user to get any changes made to your Windows PATH statement to take effect.) Quote Link to comment 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.