Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In my server (Newly launched) when I am trying to upgrade MediaWiki. I am getting the following error.

php: error while loading shared libraries: cannot open shared object file: No such file or directory

But when i check in server i can find the

183~# cd /pkg/products/httpd/httpd_2.2.19a_RH5_64/php/lib/ 183lib# ls

-la total 72556 drwxr-xr-x 3 root root 4096 Sep 16 15:43 . drwxr-xr-x 6 root root 4096 Sep 16 11:37 ..

-rw-r--r-- 1 root root 52439406 Aug 18 08:31

-rw-r--r-- 1 root root 1786841 Aug 18 09:06

-rw-r--r-- 1 root root 0 Aug 18 08:26

-rw-r--r-- 1 root root 5264820 Aug 18 08:26

-rw-r--r-- 1 root root 5264820 Aug 18 08:26

-rw-r--r-- 1 root root 7898628 Aug 18 08:32

-rw-r--r-- 1 root root 539497 Aug 18 09:03

-rw-r--r-- 1 root root 539497 Aug 18 09:03

-rw-r--r-- 1 root root 365454 Aug 18 09:05 drwxr-xr-x 4 root root 4096 Sep 16 11:37 php

183 lib# pwd /pkg/products/httpd/httpd_2.2.19a_RH5_64/php/lib

In server PHP 5.3.6 (cli) (built: May 9 2011 11:39:53) version is running.

share|improve this question
up vote 3 down vote accepted

It looks like you have the libraries installed in a non standard location.

If this is the case, it could be that php simply doesn't know where to look for the libraries it needs. Try setting the LD_LIBRARY_PATH environment variable to that path before launching php, if you're running it from command line. For example in bash:

export LD_LIBRARY_PATH=/pkg/products/httpd/httpd_2.2.19a_RH5_64/php/lib

If this works you could add that path to system configuration. I don't know other distributions but Debian keeps the library paths in the file /etc/ or in the directory /etc/ You will probably be able to find a similar file in your /etc folder

share|improve this answer
Thank you very much. Its working. – Prabu Jan 23 '12 at 10:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.