phpmyadmin "Cannot load mysql extension. Please check your PHP configuration"

Discussion in 'Programming/Scripts' started by rjamesd, Oct 18, 2007.

  1. rjamesd

    rjamesd New Member

    When I attempt to visit the phpmyadmin index page i.e.

    http://localhost/phpmyadmin/index.php

    I get: Cannot load mysql extension. Please check your PHP configuration.
    error message

    Now, I assume that 'mysql extension' and PHP MySQL package are actually the same thing, but different names.

    Using synaptic debian package manager I can see that I have php5-mysql installed so I should not be getting the above error message.

    I suspect that phpmyadmin has made an assumption about the path location of the PHP MySQL package so all I need to do is find how/where phpmyadmin looks for the PHP MySQL package.

    Can you advise me where the phpmyadmin settings are stored?
     
  2. falko

    falko Super Moderator Howtoforge Staff

    You can add the line
    Code:
    extension=mysql.so
    to your php.ini (should be /etc/php5/apache2/php.ini or something like that) and restart Apache.
     
  3. rjamesd

    rjamesd New Member

    Thanks BUT It doesn't work. Still get same error.

    Thanks BUT It doesn't work. Still get same error.

    mysql.so is a file and your solution doesn't precede the mysql.so with a path for the file so it assumes that PHP will know where to look for this file, apart from the current working directory that the php.ini is in.

    On my set up, doing a find from the root / directory, find . -name mysql.so
    Gives:
    ./usr/lib/php5/20060613+lfs/mysql.so
    ./usr/lib/perl5/auto/DBD/mysql/mysql.so

    Neither of these seem to apply to my setup because info.php tells me I'm running PHP Version 4.4.4-8+etch4 (i.e. not PHP5)
    and the php.ini file is: /etc/php4/apache2/php.ini

    As I have done in other posts - when or if I find a solution to my own problem I will post it here.
     
  4. rjamesd

    rjamesd New Member

    Thanks BUT It doesn't work. Still get same error.

    Thanks BUT It doesn't work. Still get same error.

    mysql.so is a file and your solution doesn't precede the mysql.so with a path for the file so it assumes that PHP will know where to look for this file, apart from the current working directory that the php.ini is in.

    On my set up, doing a find from the root / directory, find . -name mysql.so
    Gives:
    ./usr/lib/php5/20060613+lfs/mysql.so
    ./usr/lib/perl5/auto/DBD/mysql/mysql.so

    Neither of these seem to apply to my setup because info.php tells me I'm running PHP Version 4.4.4-8+etch4 (i.e. not PHP5)
    and the php.ini file is: /etc/php4/apache2/php.ini

    As I have done in other posts - when or if I find a solution to my own problem I will post it here.
     
  5. rjamesd

    rjamesd New Member

    Solution

    The problem was that I did not have php4-mysql package installed.

    I know this because I used synaptic package manager (type synaptic at the command line) which showed that php4-mysql was not installed.

    I installed this and phpmyadmin works

    I did not follow your advice falco - I did not need to edit the php.ini file.

    But thanks anyway.
     

Share This Page