Solved

Re-Installed PHP - MySQL hooks not all working

Posted on 2010-11-12
25
1,213 Views
Last Modified: 2012-06-21
Have been having server issues after a crash, and got a lot of help from larsrohr about how to re-install PHP.  That definitely seems to be on the right track.

I issued a YUM command - "yum install php php-ldap php-mysql php-pdo".

During the installation process - everything seemed to work except I *DID* receive this.

Failed:
  mysql.i386 0:5.0.77-4.el5_5.4           php-cli.i386 0:5.1.6-27.el5  

...

Now when I run PHP at command line - I get this.

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/mysql.so' - libmysqlclient.so.15: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/mysqli.so' - libmysqlclient.so.15: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/pdo_mysql.so' - libmysqlclient.so.15: cannot open shared object file: No such file or directory in Unknown on line 0

Any ideas how to fix this?  Re-install MySQL?
0
Comment
Question by:erzoolander
  • 14
  • 10
25 Comments
 
LVL 13

Expert Comment

by:dsmile
ID: 34126219
Have you installed MySQL yet?

If yes then just try to enable mysql extension for php again
0
 
LVL 1

Author Comment

by:erzoolander
ID: 34126281
When I attempt to do anything... install, update, etc...mysql I get:

Setting up Update Process
Package(s) mysql available, but not installed.
No Packages marked for Update
0
 
LVL 12

Expert Comment

by:larsrohr
ID: 34126282
(continuing some conversation from question 26611820)
summarizing:

'yum install php-cli' yielded:
Error unpacking rpm package php-cli-5.1.6-27.el5.i386
error: unpacking of archive failed on file /usr/bin/php;4cde18e4: cpio: open

Failed:
  php-cli.i386 0:5.1.6-27.el5


I'm concerned that it seems the downloaded rpm isn't reading properly -- maybe related to the needed fsck on the disk by the server company (early sign of disk failure?).
At any rate, I've suggested 'yum reinstall mysql' to try getting libmysqlclient.so.15 back in place.  There are MySQL databases present, so 'erase' and 'reinstall' won't work so well.
0
 
LVL 1

Author Comment

by:erzoolander
ID: 34126285
re-install yields:

No Match for argument: mysql
No package mysql available.
  * Maybe you meant: mysql
Nothing to do
0
 
LVL 12

Expert Comment

by:larsrohr
ID: 34126293
Huh?  Well that's confusing.
What does 'rpm -qa |grep mysql' yield?
Does 'yum reinstall mysql.i386' work any better?
0
 
LVL 1

Author Comment

by:erzoolander
ID: 34126295
rpm yields - php-mysql-5.1.6-27.el5

the yum reinstall produces more of the same:

No Match for argument: mysql.i386
No package mysql.i386 available.
  * Maybe you meant: mysql
Nothing to do
0
 
LVL 12

Expert Comment

by:larsrohr
ID: 34126297
Hey, while we're at it, what do you get from:
  ls -ld /usr/bin
0
 
LVL 1

Author Comment

by:erzoolander
ID: 34126301
drwxr-xr-x 2 root root 36864 Nov 10 04:03 /usr/bin
0
 
LVL 12

Expert Comment

by:larsrohr
ID: 34126309
OK, your rpm output indicates that neither mysql nor mysql-server are installed.  The "No Match" messages from yum are consistent with the packages not being already on your system.
You should be able to install them now without hurting any database info.
  yum install mysql-server
0
 
LVL 1

Author Comment

by:erzoolander
ID: 34126320
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : mysql                                                    1/3
Error unpacking rpm package mysql-5.0.77-4.el5_5.4.i386
warning: /etc/my.cnf created as /etc/my.cnf.rpmnew
error: unpacking of archive failed on file /usr/bin/msql2mysql;4cde2fa0: cpio: open
  Installing     : perl-DBD-MySQL                                           2/3
  Installing     : mysql-server                                             3/3
Error unpacking rpm package mysql-server-5.0.77-4.el5_5.4.i386
error: unpacking of archive failed on file /usr/bin/innochecksum;4cde2fa0: cpio: open

Dependency Installed:
  perl-DBD-MySQL.i386 0:3.0007-2.el5                                            

Failed:
  mysql.i386 0:5.0.77-4.el5_5.4       mysql-server.i386 0:5.0.77-4.el5_5.4      

Complete!

---
0
 
LVL 1

Author Comment

by:erzoolander
ID: 34126337
Dunno if this has anything to do with it - but I just attempted to stop mysql.  Here's what I got.

/etc/init.d/mysqld start
/etc/init.d/mysqld: line 27: /usr/bin/my_print_defaults: No such file or directory
/etc/init.d/mysqld: line 27: /usr/bin/my_print_defaults: No such file or directory
/etc/init.d/mysqld: line 27: /usr/bin/my_print_defaults: No such file or directory
/etc/init.d/mysqld: line 27: /usr/bin/my_print_defaults: No such file or directory
Initializing MySQL database:  /etc/rc.d/init.d/functions: line 500: /usr/bin/mysql_install_db: No such file or directory
                                                           [FAILED]
chown: cannot access `/var/lib/mysql': No such file or directory
0
 
LVL 1

Author Comment

by:erzoolander
ID: 34126340
I copied/pasted the "start" - sorry for the typo :)
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 12

Expert Comment

by:larsrohr
ID: 34126346
OK, another approach -- what does 'lsattr /usr |grep bin' give you?
It should be something like:
----------I-- /usr/bin

If there's a lowercase 'i' in it (----i-----I-- /usr/bin) -- 'i' for immutable -- then you can remove it with 'chattr -i /usr/bin' and then try the yum install command again.
0
 
LVL 1

Author Comment

by:erzoolander
ID: 34126349
----------I-- /usr/sbin
-u--ia----I-- /usr/bin

so - with that response - should I do chattr -i /usr/bin?
0
 
LVL 12

Expert Comment

by:larsrohr
ID: 34126354
Huh.  Definitely do the chattr -i /usr/bin
I don't know if the 'a' will be a problem yet.  Might need chattr -a /usr/bin if the yum install fails still.
0
 
LVL 1

Author Comment

by:erzoolander
ID: 34126375
'k - after removing the a - it re-installed mysql properly.

When I run PHP at command, it no longer kicks out any of the connection errors.

I *don't* think that the PHP and MYSQL hook is working yet though...the one part that's still failing is:

 php-cli.i386 0:5.1.6-27.el5
0
 
LVL 12

Expert Comment

by:larsrohr
ID: 34126417
yum install php-cli  is failing?  What error is it giving now?
0
 
LVL 1

Author Comment

by:erzoolander
ID: 34126423
The same RPM one it was before.  Weird - because everything else went through - except that one.

Error unpacking rpm package php-cli-5.1.6-27.el5.i386
error: unpacking of archive failed on file /usr/bin/php: cpio: rename

Failed:
  php-cli.i386 0:5.1.6-27.el5  

could it be that the /usr/bin/php file needs something done to it?
0
 
LVL 1

Author Comment

by:erzoolander
ID: 34126439
/usr/bin/php is

-u--ia------- /usr/bin/php

think if I remove the i and a it'll allow it?
0
 
LVL 12

Expert Comment

by:larsrohr
ID: 34126446
a little different:  "cpio: rename" this time.
Check again for 'ls -l /usr/bin/php' and 'lsattr /usr |grep bin'.

If there's already a /usr/bin/php, but rpm doesn't know of a package owning it (rpm -qf /usr/bin/php should list the package providing the file), then it could just be in the way; moving/removing it should be fine, if it helps get php-cli installed.
0
 
LVL 12

Expert Comment

by:larsrohr
ID: 34126448
Yeah, get rid of the ia attributes.
0
 
LVL 1

Author Comment

by:erzoolander
ID: 34126451
-rwxr-xr-x 1 root root 2697320 Mar 31  2010 /usr/bin/php

----------I-- /usr/sbin
-u--------I-- /usr/bin

and the rpm response:

php-cli-5.1.6-24.el5_4.5

Looks like it's an earlier version of php-cli.  Should I delete it?
0
 
LVL 12

Accepted Solution

by:
larsrohr earned 500 total points
ID: 34126455
Nah, just update it:
  yum update php-cli
0
 
LVL 1

Author Comment

by:erzoolander
ID: 34126469
That was it!  Thank you!  :)

As I said before - you've been a godsend!
0
 
LVL 1

Author Closing Comment

by:erzoolander
ID: 34126470
This guy rocks!
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now