Jump to content

Cannot load mysql extension. Please check your PHP configuration. - Documentatio


Recommended Posts

Hello,

 

I get this error when trying to load phpmyadmin. From what I have read so far it sounds like I need to enable php_mysql.dll extension but I cant find this anywhere in my php.ini file.

 

Im running a apache 2.2 PHP 5.2 and MySQL 5.1. Im a beginner and really want to get started learning PHP, any help would greatly appreciated.

Link to comment
Share on other sites

Search for "Dynamic Extensions" and write in the file (you should see examples):

extension=php_mysql.dll

 

Then restart Apache.

 

I put in the code and I'm still getting the same error. Maybe its just a simple syntax error that Im not seeing. Here is the code -

 

;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;

; If you wish to have an extension loaded automatically, use the following
; syntax:
;
;   extension=modulename.extension
;
; For example, on Windows:
;
   extension=msql.dll
;
; ... or under UNIX:
;
;   extension=msql.so
;
; ... or with a path:
;
;   extension=/path/to/extension/msql.so
;
; If you only provide the name of the extension, PHP will look for it in its
; default extension directory.

 

All I did was remove the semicolon from extension=msql.dll

 

Here is the code for config.inc.php -

<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* phpMyAdmin sample configuration, you can use it as base for
* manual configuration. For easier setup you can use setup/
*
* All directives are explained in Documentation.html and on phpMyAdmin
* wiki <http://wiki.phpmyadmin.net>.
*
* @version $Id$
* @package phpMyAdmin
*/

/*
* This is needed for cookie based authentication to encrypt password in
* cookie
*/
$cfg['blowfish_secret'] = 'happy'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

/*
* Servers configuration
*/
$i = 0;

/*
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = false;

/* rajk - for blobstreaming */
$cfg['Servers'][$i]['bs_garbage_threshold'] = 50;
$cfg['Servers'][$i]['bs_repository_threshold'] = '32M';
$cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;
$cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';

/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'root';
$cfg['Servers'][$i]['controlpass'] = 'running';
/* Advanced phpMyAdmin features */
// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
// $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
// $cfg['Servers'][$i]['relation'] = 'pma_relation';
// $cfg['Servers'][$i]['table_info'] = 'pma_table_info';
// $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
// $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
// $cfg['Servers'][$i]['column_info'] = 'pma_column_info';
// $cfg['Servers'][$i]['history'] = 'pma_history';
// $cfg['Servers'][$i]['tracking'] = 'pma_tracking';
// $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
/* Contrib / Swekey authentication */
// $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf';

/*
* End of servers configuration
*/

/*
* Directories for saving/loading files from server
*/
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';

?>

Link to comment
Share on other sites

What server are you running?

 

You may have to download the mysql.dll, or possibly just move it to another folder.

 

I think you just have to move php_mysql.dll from the main PHP folder to the /ext folder.

 

Take note of the commented php.ini below.

;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;

; If you wish to have an extension loaded automatically, use the following
; syntax:
;
;   extension=modulename.extension
;
; For example, on Windows:
;
;   extension=msql.dll     //<-DO NOT DO IT HERE-> 
;
; ... or under UNIX:
;
;   extension=msql.so
;
; ... or with a path:
;
;   extension=/path/to/extension/msql.so
;
; If you only provide the name of the extension, PHP will look for it in its
; default extension directory.
;
; Windows Extensions
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
; extension folders as well as the separate PECL DLL download (PHP 5).
; Be sure to appropriately set the extension_dir directive.
; 
;extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_dba.dll
;extension=php_exif.dll
;extension=php_fileinfo.dll
extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mbstring.dll
;extension=php_ming.dll
;extension=php_mssql.dll
extension=php_mysql.dll   //<-DO IT HERE-> NOTICE A DIFFERENCE IN THE NAME.
extension=php_mysqli.dll
;extension=php_oci8.dll      ; Use with Oracle 10gR2 Instant Client
;extension=php_oci8_11g.dll  ; Use with Oracle 11g Instant Client
;extension=php_openssl.dll
;extension=php_pdo_firebird.dll
;extension=php_pdo_mssql.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_phar.dll
;extension=php_pspell.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_soap.dll
;extension=php_sockets.dll
;extension=php_sqlite.dll
;extension=php_sqlite3.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll
;extension=php_zip.dll

Link to comment
Share on other sites

I cant find this anywhere in my php.ini file

 

If your php.ini did not already have a line in it to load the mysql.dll that you simply needed to uncomment and restart your web server, then it is likely that the method you used to install php requires that you do something completely different to enable an extension.

 

How exactly did you install php?

Link to comment
Share on other sites

jcbones - I'm using Apache. I did find the php_mysql.dll file in a ext. folder. I also did as followed below and still no luck.

;extension=php_mssql.dll
extension=php_mysql.dll   //<-DO IT HERE-> NOTICE A DIFFERENCE IN THE NAME.
extension=php_mysqli.dll
;extension=php_oci8.dll      ; Use with Oracle 10gR2 Instant Client
;extension=php_oci8_11g.dll  ; Use with Oracle 11g Instant Client
;extension=php_openssl.dll
;extension=php_pdo_firebird.dll

Link to comment
Share on other sites

I cant find this anywhere in my php.ini file

 

If your php.ini did not already have a line in it to load the mysql.dll that you simply needed to uncomment and restart your web server, then it is likely that the method you used to install php requires that you do something completely different to enable an extension.

 

How exactly did you install php?

 

My mistake it did have a line in it to load php_mysql.dll.

 

I installed all 3 indivdually without the ssl or the msi installer

Link to comment
Share on other sites

Is the php.ini that you are changing the one that php is using?

I tried to go the xampp way of doing it but it wasnt until I went through the whole processes that I learned xampp doesnt support 64 bit systems(this should be on the main pg, its not!).  So I reinstalled everything again for the umpteenth time and still the same problem. I followed the tutorial(others also) to the t and I'm at a total loss to what is going on here.

 

Yes I am. I'm using PHP/php.ini  . I wasnt aware that there was others.  Im having weird things happen with my apache server and I'm thinking maybe thats related. For me to restart my server I have to restart the pc. When I try to do it in the control panel is says something about port 80 not accessible which makes no sense to me because this is all for local development on my personal pc.

 

JCbones -Thanks, I looked at that tutorial and it does the same thing as the one I've been using.

Link to comment
Share on other sites

Thanks, I checked that and it is C:\PHP\php.ini  which is the filel I've been editing. I'm beginning to think it has to do with windows 7 and security issues. I guess I will have to stick with the Command Client for now.  Other than the phpmyadmin being a graphical interface for easier use is there other advantages in using phpmyadmin?

 

Also this might be tied into my problem. When I download MySQL and I get to the password part of the wizard I have to enter three passwords. The old one, the new one and the new one again to confirm. Apparently my old password is in the system from the first time I installed MySQL.  I made all three passwords the same. I used Ccleaner which usually uninstalls everything so I'm not sure about this password thing.

Link to comment
Share on other sites

I was looking at a old tutorial and noticed that they had you edit a php.ini file that you were to put in c:\windows . Is this required on the newer versions of PHP. I'm using 5.3.5.

Yes.  Like Mabismad said:

The phpinfo() output tells you if/which php.ini that php is using as the Loaded Configuration File value.

Link to comment
Share on other sites

I'm going to guess that when you edited your php.ini that you used some Microsoft supplied program and it got saved as php.ini.txt and php is reading the unedited php.ini file.

 

Do you have your operating system configured to display all file extensions (extensions for known file types are hidden by default)?

Link to comment
Share on other sites

I'm going to guess that when you edited your php.ini that you used some Microsoft supplied program and it got saved as php.ini.txt and php is reading the unedited php.ini file.

 

Do you have your operating system configured to display all file extensions (extensions for known file types are hidden by default)?

 

I'm glad you brought that up because one of the many tutorials that I have gone thru brought that up and I made sure to do what was necessary. It is saved as php.ini  Does this file need to be in C:/windows

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.