Forum Moderators: bakedjake

Message Too Old, No Replies

cannot load mysql extension,please check PHP Configuration

         

kwick

1:55 am on Aug 30, 2005 (gmt 0)

10+ Year Member



ok i will give you all a quick run down on what has happened. i have been running mandrake 10.0 with Apache version 2.0.48 MySQL version 4.0.18 PHP Version 4.3.4 for about 7 months now as a web server. i was not aware that this os wrote backups everyday. due to this the one partition became full and the os shut down. now i booted into knoppix made the partition writeable then mounted the partition,once that was done i opened a terminal then loged in as root su then password. once there i used the comand konqueror ./ then directed mysely to the directory root/var/tmp and deleted all the files in there and also did the same for root/var/logs. this is what i was told from the os site. once that was done i could boot into the os and restart the server or so i thought.this is wear i am getting lost i type in the url and get the message

Fatal error: Call to undefined function: mysql_connect() in /var/www/html/config/config.php on line 7

now i have also tryed to log into phpmyadmin and get this message

cannot load mysql extension,
please check PHP Configuration

and a link to this help section

To connect to a MySQL server, PHP needs a set of MySQL functions called "MySQL extension". This extension may be part of the PHP distribution (compiled-in), otherwise it needs to be loaded dynamically. Its name is probably mysql.so or php_mysql.dll. phpMyAdmin tried to load the extension but failed.
Usually, the problem is solved by installing a software package called "PHP-MySQL" or something similar.

now i have looked everywear for these extentions but can not seem to be able to find them. is there someware i can get these and add them to the serer, or do i have to reload the hole thing and start from scratch. this server has been down for over a week now and i am running out of things to try. thanks for any help

kwick

encyclo

2:01 am on Aug 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to the forums, kwick.

Assuming you were using the default packages (and didn't recompile everything), have you tried simply reinstalling or removing/reinstalling MySQL?

urpmi MySQL

(or

urpme MySQL
to remove)?

From your description, it looks as if you have simply wiped your MySQL installation by accident.

kwick

2:07 am on Aug 30, 2005 (gmt 0)

10+ Year Member



ok i still have the sql running i have a complete data base for the site just cant get the 2 programs to talk. now i have looked for the file php_mod_mysql and cant find it anywear. i have not tryed to uninstall and reinstall yet was hoping to get this back up without going that rout but if it is the only option i will.

[edited by: kwick at 2:09 am (utc) on Aug. 30, 2005]

wheel

2:09 am on Aug 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Could also be that mysql isn't running (might not be autostarting when you reboot the server).

To check to see if it's running enter the following command:
ps aux¦grep mysql

If you get results, it's running. Otherwise, type in as root:

service mysqld start

wheel

2:13 am on Aug 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



One other thought, maybe you've got an old pid file lying around, so mysql can't start. If mysql won't start, check (I think) in /var/lib/msyql for a file named mysql.pid. If mysql isn't running, delete it and try to start mysql again.

I wouldn't delete the file if mysql is running. No idea what happens if you did that. Can't imagine it would be pleasant.

You could also try something like:
urpmi php-mysql
but I don't think that's the problem.

kwick

2:20 am on Aug 30, 2005 (gmt 0)

10+ Year Member



mysql is running have not trouble there i have checked that part and for the urpmi php-mysql it says there is no package named php-mysql this is wear i am lost at i know i am in need of a file along the lines of that

kwick

wheel

1:25 pm on Aug 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I just ran 'urpmi php-mysql' and got 'everything already installed'. Which means there is a package by that name.

If your urpmi database doesn't have a package by that name you probably need to update your mirror list. Here's what I'd do next as root:

urpmi.removemedia -a (kills your existing mirror list)

then browse to 'http://easyurpmi.zarb.org' go through step 1,2 and 3 and you'll end up with a series of commands you can run at the command prompt when logged in as root. That'll update your mirror list.

then once again enter 'urpmi php-mysql'.

Keep us posted.

kwick

12:12 am on Aug 31, 2005 (gmt 0)

10+ Year Member



thanks that worked. but now i had to upgrade the apache php and mysql . all went well until i went to upgrade mysql and now i get this error when i goto the site
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
and i get this error when i try to start mysql
sh: line 1: /etc/rc.d/init.d/mysql: No such file or directory
there has been a few other problems now also. like i cannot access system/congiguration/configure your computer adn also i can not access add and removr packages or even urmpi them when i try to urpmi from a terminal i get this message
root@www root]# urpmi php
Can't locate urpmi.pm in @INC (@INC contains:
/usr/lib/perl5/5.8.6/i386-linux /usr/lib/perl5/5.8.6
/usr/lib/perl5/site_perl/5.8.6/i386-linux
/usr/lib/perl5/site_perl/5.8.6
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.6/i386-linux
/usr/lib/perl5/vendor_perl/5.8.6
/usr/lib/perl5/vendor_perl/5.8.3
/usr/lib/perl5/vendor_perl/5.8.2
/usr/lib/perl5/vendor_perl/5.8.1
/usr/lib/perl5/vendor_perl .) at /usr/sbin/urpmi line
23.
BEGIN failed--compilation aborted at /usr/sbin/urpmi
line 23.
[root@www root]#
now when i goto /usr/sbin/urpmi line
23. i get this
line 23 = use urpmi;

now i have tryed to delete the urpmi again and reinstall but i get this error

root@www root]# urpmi.removemedia
Can't locate URPM.pm in @INC (@INC contains:
/usr/lib/perl5/5.8.6/i386-linux /usr/lib/perl5/5.8.6
/usr/lib/perl5/site_perl/5.8.6/i386-linux
/usr/lib/perl5/site_perl/5.8.6
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.6/i386-linux
/usr/lib/perl5/vendor_perl/5.8.6
/usr/lib/perl5/vendor_perl/5.8.3
/usr/lib/perl5/vendor_perl/5.8.2
/usr/lib/perl5/vendor_perl/5.8.1
/usr/lib/perl5/vendor_perl .) at
/usr/lib/perl5/vendor_perl/5.8.3/urpm.pm line 13.
BEGIN failed--compilation aborted at
/usr/lib/perl5/vendor_perl/5.8.3/urpm.pm line 13.
Compilation failed in require at
/usr/sbin/urpmi.removemedia line 25.
BEGIN failed--compilation aborted at
/usr/sbin/urpmi.removemedia line 25.
[root@www root]#

thanks so far for all the help

kwick

wheel

5:24 pm on Aug 31, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ooof. One problem leads to another. I think you've got some complex issues happening and would guess that you've deleted quite a chunk of stuff.

My first reaction is that you've deleted some perl libraries that you need. And I want to start suggesting installing CPAN and all that stuff but.....

How badly hung up are you right now? If I was in your situation with a bunch of stuff not working like this (and no easy way to figure out what's missing) I'd be thinking very hard about a bare metal install. Backup all your data and do a fresh install.

If you do that, and your mirrors are up to date, then as you find packages that aren't installed you can just use urpmi or CPAN to install them, knowing that all the versions are in sync.

Otherwise, I think you're in the position of having to figure out what package is causing the problem, install it, try again and see what breaks. Then find out what's causing that to break, install it, etc.

Sorry - not good news but that would be my approach right now.

kwick

8:40 pm on Aug 31, 2005 (gmt 0)

10+ Year Member



questin for ya maybe this will help maybe not, in the files
urpmi.removemedia what do you have on line 25 mine is use urpm;

then the file urpmi on line 23 i alos have use urpm;

was wondering if that was correct

also everything was working or at least seem to until i went to upgrade the mysql i updated the apache and php went to the url and got a message about not haveing permitions to view root@localhost this is when i upgraded the sql and all this stull above happened

kwick

wheel

1:40 pm on Sep 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sounds like you've hammered your my.conf file. See if you've got a backup you can restore from - that might make things smooth out for you.

At the same time, check if your /etc/php.ini file got overwritten. And for good measure, check /etc/http/conf/ files. If they look like default files, make a backup of them then try restoring these from a backup. Restart apache and mysql and see how that goes.

I've done urpmi updates and had the config files overwritten. That can make things interesting for a few minutes.

(I'm admittedly struggling here. Seems like you've got a number of things going wrong that are tough to check from afar).

kwick

1:21 am on Sep 2, 2005 (gmt 0)

10+ Year Member



ok i have checked these files /etc/php.ini and they seem to be ok i have made up a basic php page and have gone to www.mysite.com/sathellow.php and the text show up like they should.now i have also checked out /etc/http/conf/ files. now everything seems ok but the textfile this is blank. now my question is there a way to step back say 5 days like you can on windows if so thanks

kwick

wheel

2:28 pm on Sep 2, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not that I'm aware of. That's what backups are for:).

Now would be a good time to implement a good backup procedure if you don't have one in place. I use rsync to back up every night.

kwick

11:11 pm on Sep 2, 2005 (gmt 0)

10+ Year Member



thanks bud for all your help i am going to try an upgrade to 2005 and see what happens maybe this will correct the problems i hope

kwick

kwick

11:59 pm on Sep 2, 2005 (gmt 0)

10+ Year Member



ok great news upgradeing to 2005 has corrected the problems i think now when i goto the site i get this message

Access denied for user 'root'@'localhost' (using password: YES)

i am lost with this i am not sure what i need to change thanks for any input

kwick

kwick

7:28 pm on Sep 3, 2005 (gmt 0)

10+ Year Member



i just want to thank wheel for all the hard work he has done to help me get my server back up and running. a better person you can not find anyware, he is a real asset for anysite to have thanks so much!

kwick