Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1275
  • Last Modified:

Re-Installed PHP - MySQL hooks not all working

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
erzoolander
Asked:
erzoolander
  • 14
  • 10
1 Solution
 
dsmileCommented:
Have you installed MySQL yet?

If yes then just try to enable mysql extension for php again
0
 
erzoolanderAuthor Commented:
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
 
larsrohrCommented:
(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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
erzoolanderAuthor Commented:
re-install yields:

No Match for argument: mysql
No package mysql available.
  * Maybe you meant: mysql
Nothing to do
0
 
larsrohrCommented:
Huh?  Well that's confusing.
What does 'rpm -qa |grep mysql' yield?
Does 'yum reinstall mysql.i386' work any better?
0
 
erzoolanderAuthor Commented:
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
 
larsrohrCommented:
Hey, while we're at it, what do you get from:
  ls -ld /usr/bin
0
 
erzoolanderAuthor Commented:
drwxr-xr-x 2 root root 36864 Nov 10 04:03 /usr/bin
0
 
larsrohrCommented:
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
 
erzoolanderAuthor Commented:
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
 
erzoolanderAuthor Commented:
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
 
erzoolanderAuthor Commented:
I copied/pasted the "start" - sorry for the typo :)
0
 
larsrohrCommented:
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
 
erzoolanderAuthor Commented:
----------I-- /usr/sbin
-u--ia----I-- /usr/bin

so - with that response - should I do chattr -i /usr/bin?
0
 
larsrohrCommented:
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
 
erzoolanderAuthor Commented:
'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
 
larsrohrCommented:
yum install php-cli  is failing?  What error is it giving now?
0
 
erzoolanderAuthor Commented:
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
 
erzoolanderAuthor Commented:
/usr/bin/php is

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

think if I remove the i and a it'll allow it?
0
 
larsrohrCommented:
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
 
larsrohrCommented:
Yeah, get rid of the ia attributes.
0
 
erzoolanderAuthor Commented:
-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
 
larsrohrCommented:
Nah, just update it:
  yum update php-cli
0
 
erzoolanderAuthor Commented:
That was it!  Thank you!  :)

As I said before - you've been a godsend!
0
 
erzoolanderAuthor Commented:
This guy rocks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 14
  • 10
Tackle projects and never again get stuck behind a technical roadblock.
Join Now