Solved

PHP Not working after server "fix" (question)

Posted on 2010-11-12
17
653 Views
Last Modified: 2012-05-10
We've been having all sorts of problems with our server.  It went down a few days ago - and after a "fix" - all of the PHP scripts are giving 403 errors...and I'm trying to narrow it down.

When I go to shell - and try to execute a PHP command - I get the following:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/dbase.so' - /usr/lib/php/modules/dbase.so: 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/ldap.so' - /usr/lib/php/modules/ldap.so: 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/mysql.so' - /usr/lib/php/modules/mysql.so: 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' - /usr/lib/php/modules/mysqli.so: 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.so' - /usr/lib/php/modules/pdo.so: 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' - /usr/lib/php/modules/pdo_mysql.so: 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_sqlite.so' - /usr/lib/php/modules/pdo_sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0

None of the files it's trying to load exist on the server.  Does this mean that our install of PHP is "broken" (for lack of a better way of putting it) - and might this be causing the 403 Forbidden errors?

...and do I have to reinstall PHP?
0
Comment
Question by:erzoolander
  • 9
  • 8
17 Comments
 
LVL 12

Expert Comment

by:larsrohr
ID: 34125882
Yes, if these files aren't available, then your PHP is "broken".  What was the server "fix"?  Maybe these files exist on a filesystem that still needs mounting or needs fsck?  If they can't be re-accessed or recovered, then you will need to reinstall PHP.
0
 
LVL 1

Author Comment

by:erzoolander
ID: 34125892
The server went down...the server company did a manual fsck to bring it back up.  After that - it has ceased to work/ceased running PHP scripts (giving 403 errors).

Sooo - apparently they're not prepared to do anything to make it work and it's fallen upon my shoulders to fix it.  I'm now playing detective.
0
 
LVL 12

Expert Comment

by:larsrohr
ID: 34125904
I would check the path:
  ls -ld /usr /usr/lib /usr/lib/php /usr/lib/php/modules

This will help determine what's missing.

Also, are you able to view /etc/fstab (/etc/vfstab on Solaris)?
0
 
LVL 1

Author Comment

by:erzoolander
ID: 34125928
Thanks for the help :)

Nothing in the modules directory.  Empty.

FSTAB - yep - it says:

LABEL=/                 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
LABEL=SWAP-sda2         swap                    swap    defaults        0 0
none      /dev/shm        tmpfs   defaults,noexec,nosuid  0 0
/usr/tmpMnt             /tmp                    ext3    loop,nosuid,noexec,rw   0 0
0
 
LVL 12

Expert Comment

by:larsrohr
ID: 34125958
Ugh.  I wonder if the disk was having trouble right at your modules directory.  :-)

Any automounting going on, that you're aware of?  (Check /etc/auto.master, and "ps -eaf |grep automount", for instance)
Assuming not, and that the server company doesn't have a "restore request" feature, then it's looking to me like you may have to reinstall php and php-related packages.
0
 
LVL 1

Author Comment

by:erzoolander
ID: 34125970
that's what I'm thinking too.

Does this look pretty complete?

http://www.developertutorials.com/tutorials/php/how-to-install-php-5-on-linux-7-12-19-961/
0
 
LVL 12

Accepted Solution

by:
larsrohr earned 500 total points
ID: 34125999
Looks like a good start, if you need to compile from source.
What kind of Linux is it?  Do you have rpm/yum installs as an option?

Judging by the missing modules you mentioned, you'd need to install rpms for:
php
php-ldap
php-mysql
php-pdo

"yum install php php-ldap php-mysql php-pdo" would do it on CentOS/Fedora.

Compiling from source, you could follow the instructions you found, but you might need to add to the configure command:
 --with-ldap --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd

Are each of those modules explicitly needed?  If they're not, and they were previously just loaded because they were available, then you could edit php.ini to comment them out.  And then you might not need some of the compile options (like --with-pdo-mysql).
0
 
LVL 1

Author Comment

by:erzoolander
ID: 34126003
Yep - we've got yum.  I'll do that.

Thanks a lot man!  You've been a great help!
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 1

Author Comment

by:erzoolander
ID: 34126053
'k - ran the YUM and it seemed to have worked for the MOST part...but have this response coming now.

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

During the install - one thing *did* say it failed.

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

Any ideas?
0
 
LVL 12

Expert Comment

by:larsrohr
ID: 34126108
Hmm.  Was there any message about why installation failed?
Could you try yum again:
  yum install php-cli php-mysql
0
 
LVL 1

Author Comment

by:erzoolander
ID: 34126131
failed again - here's what it says

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
0
 
LVL 12

Expert Comment

by:larsrohr
ID: 34126173
Are those two packages already showing as installed?
rpm -q php-cli
rpm -q php-mysql

Just want to double-check.  I think the error you're getting may, unfortunately, mean that the downloaded php-cli rpm isn't being read properly -- as would be the case if the disk is suffering additional problems.

Could try:
yum clean all
yum install php-cli php-mysql

Use "update" instead of "install" if rpm says the packages are already installed.

You might also do a "grep -i smartd /var/log/messages" to see if there are disk error messages being logged.
0
 
LVL 1

Author Comment

by:erzoolander
ID: 34126205
Nope - no disk errors logged.

clean, install and update had the same net effect.  Same error.

Think if I un-install (would that be yum erase) PHP and then re-install it - that it might make a difference?  What about re-installing MySQL?

Whatever it seems to be - RPM is having difficulty with that file.  Maybe compiling from source?
0
 
LVL 12

Expert Comment

by:larsrohr
ID: 34126217
Yeah, I think it's the rpm file that's the problem.  'yum clean' was meant to delete it so it could be re-created.

Does the mysql rpm give you the same cpio error?
I would try re-installing MySQL, rather than PHP.
 yum erase mysql
 yum install mysql php-mysql
0
 
LVL 1

Author Comment

by:erzoolander
ID: 34126223
Quick question...before i do that..  Will that impact the existing mysql databases I have in there?  They're still in tact.
0
 
LVL 12

Expert Comment

by:larsrohr
ID: 34126266
Hmm.  Yup, 'yum erase mysql' will want to also erase mysql-server.
How about 'yum reinstall mysql' ?  We really just want to get libmysqlclient.so.15 back in place.

Shall we take this over to your other question (26612333)?
0
 
LVL 1

Author Comment

by:erzoolander
ID: 34126269
yeah - I want you to get the next 500 points too...thanks so much man!  You're a godsend.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
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 a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

707 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

17 Experts available now in Live!

Get 1:1 Help Now