Solved

Re-Installed PHP - MySQL hooks not all working

Posted on 2010-11-12
25
1,229 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2

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
Veeam gives away 10 full conference passes

Veeam is a VMworld 2017 US & Europe Platinum Sponsor. Enter the raffle to get the full conference pass. Pass includes the admission to all general and breakout sessions, VMware Hands-On Labs, Solutions Exchange, exclusive giveaways and the great VMworld Customer Appreciation Part

 
LVL 2

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 2

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 2

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 2

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 2

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 2

Author Comment

by:erzoolander
ID: 34126340
I copied/pasted the "start" - sorry for the typo :)
0
 
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 2

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 2

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 2

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 2

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 2

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 2

Author Comment

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

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

Author Closing Comment

by:erzoolander
ID: 34126470
This guy rocks!
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

636 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